For logging purposes: is there any difference in precision between subtracting two datetime-tz's and two etime's (to measure the elapsed time)? I know etime is "risky" because it can be reset during the call, etime(true), but apart from that?
My assumption there is no difference, but just want to verify.
versions: OE11.3 and up.
ETIME and NOW use the same OS functions to get the current time. The only differences I see are that NOW has to handle time zones so it takes a tiny bit more time to execute than ETIME and NOW will use a time server if one is available. Other than that, I believe they are both as accurate to the millisecond as the system timer allows them to be.
ETIME and NOW use the same OS functions to get the current time. The only differences I see are that NOW has to handle time zones so it takes a tiny bit more time to execute than ETIME and NOW will use a time server if one is available. Other than that, I believe they are both as accurate to the millisecond as the system timer allows them to be.
OK, thanks for confirming my assumption. I'll switch to datetime-tz for "calculating" the elapsed time in a call. Saves me from the annoyance when somebody uses etime(true) in between the begin and end of the call.
Check out the mtime function.