Here are my suggested updates to these two functions' Wiki pages. Please use the links in the function titles to see the current Wiki version.
I'm making up a graphic section division marker because the horizontal rule:
is nearly invisible.
.
SECONDS()
SECONDS Function
The SECONDS()
function returns the time in fractional seconds, starting
at an arbitrary point.
The SECONDS()
function returns CACurrentMediaTime()
(give or take a microsecond), which is part of Apple's "Core Animation" API group. According to Apple developer documentation, it "Returns the current absolute time, in seconds." and is based on mach_absolute_time()
, which, also according to Apple developer documentation, "Returns the current value of a clock that increments monotonically in tick units (starting at an arbitrary point). This clock does not increment while the system is asleep."
Please don't mistake the term "absolute time" for universal clock time like that provided by the TIME Function or the ICU Date/Time Tokens. You should use SECONDS()
if you want to keep track of time differences for short periods (such as how long a macro takes to execute).
See Also
Functions
Forum
- MACRO: Timing a Macro
- What is the Difference Between the
SECONDS()
andUPTIME()
Functions? (Answer by Peter N. Lewis)
UPTIME()
UPTIME Function
The UPTIME() function returns the time in fractional seconds that the Mac has been awake since it booted.
The UPTIME()
function returns NSProcessInfo.processInfo.systemUptime
. According to Apple developer documentation, "The amount of time the system has been awake since the last time it was restarted."
Use UPTIME()
for the time (accurate to a few milliseconds) since the Mac was rebooted. Use SECONDS()
if you want to keep track of time differences for short periods (such as timing how long a macro takes to execute).