How does work the time and localtime function in mods/pub/stdc.mod/stdc.bmx ?
Function time_(time:Byte Ptr)
Print(time_(Null)) is this the unix time?
time:Byte Ptr what is this for a parameter?
cu olli
Check function Currenttime() in System.bmx.
Oh, thank you!
Is there any way, to calculate the current time with a resolution of 1 millisecond?
cu olli
Not as far as I can tell with a simple command.
Not 100% sure I have this right but I *think* it gives you the time to 1sec plus the additional ms.
Local time[256]
Local start_t:Int=MilliSecs()
While Not KeyHit(KEY_ESCAPE)
Print time_(time) + " " + ((MilliSecs()-start_t) Mod 1000)
Delay 500
Wend
The delay is just to 'slowdown' the output.
Hi!
Thank you, but this is not, what I need :) I want the current time(Unix Time) with a resolution of 1 millisecond.
I've done this actualy so:
Global StartTime : Long
StartTime = Long(time_(Null))*1000 - MilliSecs()
...
Function GetTime:Long()
Return StartTime + MilliSecs()
End Function
cu olli
For some obscure reason, BlitzMAX does not support POSIX timestamps. On Linux, I believe MilliSecs() actually does return the number of milliseconds since the POSIX Epoch (or at least it used to), but for some reason this is/was specific to the Linux implementation.