examples/timer.rb in compsci-0.0.1.1 vs examples/timer.rb in compsci-0.0.2.1
- old
+ new
@@ -16,27 +16,15 @@
puts "cumulative: %0.3f" % Timer.since(overall_start)
puts
start = Timer.now
-print "running sleep 0.02 (0.5 s): "
-_answer, each_et = Timer.loop_average(seconds: 0.5) {
+print "running sleep 0.02 (0.3 s): "
+_answer, each_et = Timer.loop_average(seconds: 0.3) {
print '.'
sleep 0.02
}
puts
puts "each: %0.3f" % each_et
puts "elapsed: %0.3f" % Timer.since(start)
puts "cumulative: %0.3f" % Timer.since(overall_start)
puts
-
-
-start = Timer.now
-print "running sleep 2 (1 s): "
-_answer, each_et = Timer.loop_average(seconds: 1) {
- print '.'
- sleep 2
-}
-puts
-puts "each: %0.3f" % each_et
-puts "elapsed: %0.3f" % Timer.since(start)
-puts "cumulative: %0.3f" % Timer.since(overall_start)