xcall MIAMEX, MX_GETTIME, secs {,usecs}
This function returns the number of seconds, and optionally microseconds, since 00:00:00 January 1, 1970, Coordinated Universal Time (aka the “Epoch”).
Parameters
secs (Num)
will receives the number of seconds elapsed since the “Epoch”. Since as of 2003 this number is well over 1 billion seconds, you would be well advised to map secs as a 4 or 5 byte binary or a floating point.
usecs (Num)
will be set to -1 if the feature is not supported (e.g. AIX, SCO) or else the number of microseconds to add to SECS. Note that under Windows, the actual resolution is only milliseconds, so USECS will always be a multiple of 1000.
The microseconds value is probably not useful in itself but could be useful for measuring the amount of time that a very short operation takes (by calling MIAMEX,MX_GETTIME twice, once before and once after). The MIAMEX.BP sample program in [908,30] has been updated to do just that, showing the time to execute a FOR/NEXT loop of 10000 iterations.
Also note that if you are using this function to measure an interval, keep in mind the possibility that the system clock might get updated during that interval, rendering your results meaningless.
The TIME system variable in BASIC returns the number of seconds since midnight.