problem with time calculation

Discussion in 'Javascript' started by Michiel van der Blonk, Feb 5, 2007.

  1. It's probably something with rounding off, or floating point problems.
    I have a timer which is used when solving the Rubik's cube. It has to
    measure an exact time, but the clock display I made shows a different
    value than the actual time (also displayed after session: ...). I am
    using the same variable for both displays. sometimes it's off by .02.

    page: http://vanderblonk.com/cube/cubetimer.htm (just look at the
    source).

    thx for any help
    Michiel
    Michiel van der Blonk, Feb 5, 2007
    #1
    1. Advertising

  2. On Feb 4, 9:07 pm, "Michiel van der Blonk" <> wrote:
    > It's probably something with rounding off, or floating point problems.
    > I have a timer which is used when solving the Rubik's cube. It has to
    > measure an exact time, but the clock display I made shows a different
    > value than the actual time (also displayed after session: ...). I am
    > using the same variable for both displays. sometimes it's off by .02.
    >
    > page:http://vanderblonk.com/cube/cubetimer.htm(just look at the
    > source).


    I already found out myself: when I set running=false the correct time
    is recorded, but then the timer continues with some lagged events and
    writes a different time on the clock. So the clock is wrong.
    Michiel van der Blonk, Feb 6, 2007
    #2
    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. falcon
    Replies:
    10
    Views:
    564
    falcon
    Mar 13, 2006
  2. mazdotnet

    Daylight saving time calculation

    mazdotnet, Oct 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    323
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
    Oct 15, 2006
  3. flamesrock
    Replies:
    8
    Views:
    438
    Hendrik van Rooyen
    Nov 24, 2006
  4. SSG

    Running time calculation

    SSG, Jul 7, 2005, in forum: C Programming
    Replies:
    3
    Views:
    460
    Anonymous 7843
    Jul 7, 2005
  5. calculation of cpu idle time

    , Aug 23, 2006, in forum: C Programming
    Replies:
    33
    Views:
    1,008
    jmcgill
    Aug 29, 2006
Loading...

Share This Page