|
@ -7,12 +7,11 @@ var setTimeout_called = false; |
|
|
|
|
|
|
|
|
assert.equal(true, setTimeout instanceof Function); |
|
|
assert.equal(true, setTimeout instanceof Function); |
|
|
var starttime = new Date; |
|
|
var starttime = new Date; |
|
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
setTimeout(function () { |
|
|
var endtime = new Date; |
|
|
var endtime = new Date; |
|
|
|
|
|
|
|
|
var diff = endtime - starttime; |
|
|
var diff = endtime - starttime; |
|
|
if (diff < 0) diff = -diff; |
|
|
assert.ok(diff > 0); |
|
|
puts("diff: " + diff); |
|
|
puts("diff: " + diff); |
|
|
|
|
|
|
|
|
assert.equal(true, 1000 - WINDOW < diff && diff < 1000 + WINDOW); |
|
|
assert.equal(true, 1000 - WINDOW < diff && diff < 1000 + WINDOW); |
|
@ -28,7 +27,7 @@ setInterval(function () { |
|
|
var endtime = new Date; |
|
|
var endtime = new Date; |
|
|
|
|
|
|
|
|
var diff = endtime - starttime; |
|
|
var diff = endtime - starttime; |
|
|
if (diff < 0) diff = -diff; |
|
|
assert.ok(diff > 0); |
|
|
puts("diff: " + diff); |
|
|
puts("diff: " + diff); |
|
|
|
|
|
|
|
|
var t = interval_count * 1000; |
|
|
var t = interval_count * 1000; |
|
|