How to code a chronometer

Hi,
I'm trying to code a simple chronometer, so when I press Start button, the chronometer will start counting. I'm not able to figure out how to code this. I have first used Sys.getTimer();, but the timer shows the time since the system started...:confused::confused:
Is there any function abailable to do this?
  • Time.now() gets a Time.Moment for the current time. If you capture that as the start time, and then periodically make the same call to get the current time, you can subtract them to get a Time.Duration, which contains the elapsed seconds.

    If you want sub-second accuracy, you'd have to use Sys.getTimer().

    Travis
  • Time.now() gets a Time.Moment for the current time. If you capture that as the start time, and then periodically make the same call to get the current time, you can subtract them to get a Time.Duration, which contains the elapsed seconds.

    If you want sub-second accuracy, you'd have to use Sys.getTimer().

    Travis


    Thnaks Travis! I will be using Time funcs in my app :rolleyes: