Mercurial > hg > Members > toma > benchmark
changeset 2:bf748d3ce84d
fix sleep
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 02 Jul 2013 16:11:28 +0900 |
parents | 1f53f31151d1 |
children | df590d4c29bd |
files | stress_read.rb |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/stress_read.rb Tue Jul 02 15:43:52 2013 +0900 +++ b/stress_read.rb Tue Jul 02 16:11:28 2013 +0900 @@ -3,11 +3,12 @@ require 'net/http' require 'benchmark' +schedule = ARGV[0].to_i +time = Time.now.to_i +sleepTime = schedule - time +sleep(sleepTime) + tms = Benchmark.measure { - schedule = ARGV[0].to_i - time = Time.now.to_i - sleepTime = schedule - time - sleep(sleepTime) count = ARGV[1].to_i count.times {|i|