Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript can get time, can it get milliseconds, or actually just tenths of seconds?

Reply
Thread Tools

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

 
 
Guy
Guest
Posts: n/a
 
      12-05-2003
JavaScript can get time, can it get milliseconds, or actually just tenths of
seconds?
Thanks for all
Guy


 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      12-05-2003
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.

 
Reply With Quote
 
 
 
 
Dr John Stockton
Guest
Posts: n/a
 
      12-05-2003
JRS: In article <y7Szb.4862$(E-Mail Removed)>, seen
in news:comp.lang.javascript, Guy <(E-Mail Removed)> posted at
Fri, 5 Dec 2003 02:33:02 :-
>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.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does a lambda actually get assigned to a std::function<>? K. Frank C++ 9 01-16-2012 04:32 AM
Actually evaluating javascript... Volte Javascript 3 09-18-2006 09:12 PM
How do I get System Restore to actually work on our computers? Grandpa Chuck Computer Support 10 06-01-2006 10:52 PM
Python ldap pointers for a newbie - Actually just trying to decifer the error.. rh0dium Python 1 07-18-2005 06:08 PM
can javascript get tenths of a second Guy Javascript 11 12-20-2003 06:44 PM



Advertisments