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

Discussion in 'Javascript' started by Guy, Dec 5, 2003.

  1. Guy

    Guy Guest

    JavaScript can get time, can it get milliseconds, or actually just tenths of
    seconds?
    Thanks for all
    Guy
     
    Guy, Dec 5, 2003
    #1
    1. Advertising

  2. Guy

    Lee Guest

    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.
     
    Lee, Dec 5, 2003
    #2
    1. Advertising

  3. JRS: In article <y7Szb.4862$>, seen
    in news:comp.lang.javascript, Guy <> 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.
     
    Dr John Stockton, Dec 5, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michelle
    Replies:
    5
    Views:
    4,237
    Michelle
    Aug 17, 2004
  2. Joe, G.I.
    Replies:
    23
    Views:
    1,820
    Kai-Uwe Bux
    Oct 14, 2008
  3. Replies:
    3
    Views:
    2,006
    Steven D'Aprano
    Jul 25, 2009
  4. Michael Tan
    Replies:
    32
    Views:
    998
    Ara.T.Howard
    Jul 21, 2005
  5. Guy
    Replies:
    11
    Views:
    203
    AmateurScripter
    Dec 20, 2003
Loading...

Share This Page