puts "=========="
puts "OCC24899"
puts "=========="
puts ""
##################################################################################################
# Time of computation of intersection points with help of class BRepIntCurveSurface_Inter is big
##################################################################################################

polyline l -10 1 1 80 1 1
explode l e

restore [locate_data_file bug24899_TheHull.brep] h1
mkcurve c1 l_1
BRepIntCS c1 h1 r
distmini dd l_1 h1

dchrono t1 reset
dchrono t1 start

for { set i 0} { $i <= 100 } {incr i} {
  BRepIntCS c1 h1 r
}

dchrono t1 stop
set time1 [dchrono t1 show]
regexp {CPU user time: ([-0-9.+eE]+) seconds} $time1 full timeint
puts "Time performing BRepIntCurveSurface =  $timeint"

dchrono t2 reset
dchrono t2 start
for { set j 0} { $j <= 100 } {incr j} {
  distmini dd l_1 h1
}

dchrono t2 stop
set time2 [dchrono t2 show]
regexp {CPU user time: ([-0-9.+eE]+) seconds} $time2 full timeextr
puts "Time performing BRepExtrema_DistShapeShape = $timeextr"

if { $timeint > 2 * $timeextr } {
  puts "Error : Time of intersection of curve with shell is more than two time from BRepExtrema"
} else {
  puts "OK: Time is good"
}
