WoW:API GetTime: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
<center>'''GetTime''' ''-Documentation by [[user:Zlixar|Zlixar]]-''</center>
<center>'''GetTime''' ''-Documentation by [[user:Zlixar|Zlixar]]- -Updated by [[user:RoQ|RoQ]]-''</center>
When called, returns the current system uptime in seconds.
When called, returns the elapsed time in seconds from the "epoch" given by [[API GetDate|GetDate()]].
  seconds = GetTime();
  elapsedSeconds = GetTime();
----
----
;''Arguments''
;''Arguments''
Line 9: Line 9:
;''Returns''
;''Returns''


:;seconds : Floating Point Number - The current system uptime in seconds.
:;elapsedSeconds : Floating Point Number - The elapsed time in seconds from the "epoch" (or "zero-hour") which is determined by [[API GetDate|GetDate()]].
----
----
;''Example''
;''Example''
Line 20: Line 20:
:This is relatively unconfirmed, though experimentation on my part has failed to find any fault in this correlation. It may, however, be possible that this tracks something such as current session uptime (as opposed to total system uptime). Any confirmation or corrections appreciated ^.^
:This is relatively unconfirmed, though experimentation on my part has failed to find any fault in this correlation. It may, however, be possible that this tracks something such as current session uptime (as opposed to total system uptime). Any confirmation or corrections appreciated ^.^


:''Added by [[user:RoQ|RoQ]]:''
:It's plausible to use GetTime() as a timestamp, in those cases where you want to verify that one thing has happened before or after another. The only exception to this is when the value of [[API GetDate|GetDate()]] changes, then (obviously) the value of GetTime() has no relationship to the value before [[API GetDate|GetDate()]] changed.
----
{{Template:WoW API}}
{{Template:WoW API}}

Revision as of 06:25, 25 February 2005

GetTime -Documentation by Zlixar- -Updated by RoQ-

When called, returns the elapsed time in seconds from the "epoch" given by GetDate().

elapsedSeconds = GetTime();

Arguments
None

Returns
elapsedSeconds
Floating Point Number - The elapsed time in seconds from the "epoch" (or "zero-hour") which is determined by GetDate().

Example
seconds = GetTime();
print("Current system uptime is: "..seconds.." seconds!");
Result
Current system uptime is: 60123 seconds!

Details
This is relatively unconfirmed, though experimentation on my part has failed to find any fault in this correlation. It may, however, be possible that this tracks something such as current session uptime (as opposed to total system uptime). Any confirmation or corrections appreciated ^.^
Added by RoQ:
It's plausible to use GetTime() as a timestamp, in those cases where you want to verify that one thing has happened before or after another. The only exception to this is when the value of GetDate() changes, then (obviously) the value of GetTime() has no relationship to the value before GetDate() changed.

Template:WoW API