Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Unable to send millisecond timeout.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alan Gutierrez  
View profile  
 More options Nov 4 2012, 1:00 am
From: Alan Gutierrez <a...@prettyrobots.com>
Date: Sun, 4 Nov 2012 01:59:57 -0400
Local: Sun, Nov 4 2012 1:59 am
Subject: Unable to send millisecond timeout.
This gist...

http://gist.github.com/4010472

...contains a program that executes a function every millisecond using
setInterval. It then uses setTimeout to executes a function every two
milliseconds, then every millisecond, then it invokes a function
repeatedly with a zero value (which is supposed to be reset to 1
according to the documentation.) Finally, it invokes a function
repeatedly using nextTick.

Using the high-resolution timer, the program samples the intervals and
prints them to standard out.

The setInterval function works as expected, invoking its callback at
millisecond intervals. With a value of 2, setTimeout will invoke its
callback after a two millisecond interval. With a value of 1 or 0,
setTimeout calls back its callback immediately, in about two
microseconds, a little bit faster than nextTick.

Is this correct? I'd expect that setTimeout would always wait for at
least a millisecond before invoking its callback.

--
Alan Gutierrez - @bigeasy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jorge  
View profile  
 More options Nov 4 2012, 5:09 am
From: Jorge <jorge%jorgechamorro....@gtempaccount.com>
Date: Sun, 4 Nov 2012 02:09:42 -0800 (PST)
Local: Sun, Nov 4 2012 5:09 am
Subject: Re: Unable to send millisecond timeout.

On 4 nov, 07:00, Alan Gutierrez <a...@prettyrobots.com> wrote:

The setTimeout(ƒ,0) behaving as a nextTick(ƒ) is the proper behaviour
for a setTimeout(ƒ,0) with no clamping (the browsers clamp it to a
minimun of several ms, mainly due to a bug in jquery).

But, the setTimeout(ƒ,1) behaving as a setTimeout(ƒ,0) is *clearly* a
bug.

Node's timers have always been buggy -and still are- for example this:

setTimeout(a,10), setTimeout(b,10)

may fire a then b, or b then a, which is another bug.

Cheers,
--
Jorge.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Waldron  
View profile  
 More options Nov 4 2012, 1:44 pm
From: Rick Waldron <waldron.r...@gmail.com>
Date: Sun, 4 Nov 2012 13:43:29 -0500
Local: Sun, Nov 4 2012 1:43 pm
Subject: Re: [nodejs] Re: Unable to send millisecond timeout.

On Sun, Nov 4, 2012 at 5:09 AM, Jorge <

What "bug" in jQuery are you referring to? No browser vendor/implementor
would make any such concessions.

Rick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexey Kupershtokh  
View profile  
 More options Nov 4 2012, 11:13 pm
From: Alexey Kupershtokh <alexey.kupersht...@gmail.com>
Date: Sun, 4 Nov 2012 20:13:58 -0800 (PST)
Local: Sun, Nov 4 2012 11:13 pm
Subject: Re: Unable to send millisecond timeout.

I think it's about this bug in node.js
https://github.com/joyent/node/pull/4194
setTimeout(..., 1) can sometimes behave as process.nextTick.
Also setTimeout(..., 0) is the same to setTimeout(..., 1) because of this
line: https://github.com/joyent/node/blob/v0.9.3/lib/timers.js#L175 and
therefore can behave as nextTick too.

воскресенье, 4 ноября 2012 г., 17:09:42 UTC+7 пользователь Jorge написал:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »