Functions dealing with time.
Takes a time in seconds and returns a string in the form "0h:0m:0s".
A string in the form "0h:0m:0s".
<seconds>
Checks if dateA is more recent than dateB.
The dates should be in the format returned by the localTime
global, or the external file methods like getFileModDate
.
True if dateA is more recent than dateB, false if opposite, or undefined on failure.
<dateA>
<dateB>
A handy timer struct, useful for timing or profiling.
Think of it as a stopwatched used to record times of a runner around a track.
Use it as follows:
t = LapTimer() -- Create a timer
t.CleanStart() -- Start timing
(...) -- do somthing here
print (t.Lap()) -- Returns how long it's been since Start() was called
(...) -- do some more stuff
print (t.Lap()) -- Returns how long it's been since the last Lap() call
(...) -- do even more stuff
print (getFormattedTime(t.Stop())) -- Stops timing, returns total time since start was called.
NOTE: If you use lap to time large time periods, be aware that it can't handle going across midnight twice between lap calls.
NOTE2: You can't time periods totaling more than 24 days or so. Live with it.
Start
CleanStart
Lap
GetLastTime
GetLapTime n
GetNumLaps
GetAllTimes
GetTotalTime
Stop
Reset