strange results from getTime()

Posted on
  • I had my Espruino running for about 2 days now.
    During testing setTimeout did not work as expected.
    I called getTime() several times in about 20 secs.
    Result jumped from 183446009.1100... to 183456363.0299.. to 183479278. 123.. to 183496674.
    I had to reboot to get correct results.

  • This is something that should be fixed in the next version 1v58 - @DrAzzy's still had problems but I've been running mine as a clock with setInterval for the last 2 days and it's still spot on.

  • JumJum - What else was your board doing before this?

    I have found that if I'm writing to the SD card, and it fails, it seems to break the timer until restart, causing it to advance at a rate far faster than 1 second per second (maybe as fast as 1s per ms). It sounds like you encountered this, since the timer was showing 183,456,363 seconds is 2123.3 days

    Actually, this is consistent with the getTime() switching to milliseconds, if you had it running for ~2.12 days after the point at which the timer started doing that.

  • Hmm, I did a lot, there was a time, where I tried to read from SD without having one connected. Sometimes I got a SD read error. During this, I restarted the board several times, therefore I don't know the status anymore.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

strange results from getTime()

Posted by Avatar for JumJum @JumJum

Actions