mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
20 lines
326 B
JavaScript
20 lines
326 B
JavaScript
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var timeouts = 0;
|
|
var Timer = process.binding('timer_wrap').Timer;
|
|
|
|
var t = new Timer();
|
|
|
|
t.start(1000, 0);
|
|
|
|
t.ontimeout = function() {
|
|
timeouts++;
|
|
console.log('timeout');
|
|
t.close();
|
|
};
|
|
|
|
process.on('exit', function() {
|
|
assert.equal(1, timeouts);
|
|
});
|