Javascript can get time, can it get milliseconds, or actually just tenths of seconds?

G

Guy

JavaScript can get time, can it get milliseconds, or actually just tenths of
seconds?
Thanks for all
Guy
 
L

Lee

Guy said:
JavaScript can get time, can it get milliseconds, or actually just tenths of
seconds?

It depends on the machine it's running on.
It reports the value in milliseconds, but the value that
it receives from the operating system is rarely, if ever
that precise.
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen
in news:comp.lang.javascript said:
JavaScript can get time, can it get milliseconds, or actually just tenths of
seconds?

The ECMA-262 language definition strongly implies that it will get no
better than milliseconds, without being quite as explicit as one might
wish.

D = new Date() always AFAIK sets D to an integer, and the routines for
handling dates make no specified allowance for fractional milliseconds.

In DOS..Win98 browsers, the time changes exactly 0x1800B0 times per 24
nominal hours, which is near 18.2 Hz or 54.9 ms. But the conversion is
to a multiple of 10 ms, so going up 50 or 60 ms each time.

In WinNT browsers, I believe that there are 10 ms steps.

Details for other systems would be welcome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top