2 Replies Latest reply on Feb 23, 2009 1:23 PM by Handycam

    Timer question: saving a best time?

    Handycam Level 1
      I have an app with a timer display that counts the time spent in the game and displays it in a Label. When the game is over, I want to save this time -- and keep track of the user's best time in this browser session.

      Currently, the timer code (attached) winds up with a nicely-formatted string. But how can I also best store it in a format for comparison at the end of the game?

      In other words, I will be checking to see if there is already a best time, and if yes compare the two and save the lower amount (i.e. their new "best time").

      The part I am confused about is what format the time is, and how to best store it? In olden times I would just start a timer and then track the number of milliseconds elapsed. But the attached code I found online is using a date object, which is a bit new to me.