Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Unexpected behaviour in Timers api (setInterval, setTimeout) #747

@brentlintner

Description

@brentlintner

Hey all,

Not sure if I am blatantly missing something, but I can not find any resource mentioning the current behaviour of setInterval/setTimeout methods in the Timers api for 0.4.x.

As per the current docs for 0.4.2, setTimeout and setInterval return a id, and can be cleared with clearInterval/clearTimeout.

http://nodejs.org/docs/v0.4.2/api/timers.html

But contrary to that, they apparently now return objects:

setTimeout (for 4000ms) returns:
{ _idleTimeout: 4000,
_onTimeout: [Function],
_idlePrev: { repeat: 4, _idleNext: [Circular], _idlePrev: [Circular], callback: [Function] },
_idleNext: { repeat: 4, _idleNext: [Circular], _idlePrev: [Circular], callback: [Function] },
_idleStart: Sun, 06 Mar 2011 00:55:16 GMT }

setInterval (every 4000ms) returns:
{ repeat: 4, callback: [Function] }

Is this expected or possibly new behaviour? I was able to clear the interval by deleting the callback property, but that I am not sure that is right... so, again, am I missing something?

For reference:

Using: v0.4.2
Platlform: Linux 2.6.35-27 (Ubuntu 10.10) x86_64

Cheers,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions