0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-22 07:37:56 +01:00
nodejs/test/test_clearTimeout.rb

15 lines
361 B
Ruby
Raw Normal View History

2009-03-04 12:04:04 +01:00
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/common"
a = Time.now
out = `#{$node} #{$tf.path}`
b = Time.now
assert_equal("hello\nworld\n", out)
assert_less_than(b - a, 1) # startup time
__END__
log("hello");
timeout1 = setTimeout(function () { log("world"); }, 500);
timeout2 = setTimeout(function () { log("ryah"); }, 5000);
clearTimeout(timeout2)