WoW:API GetTime: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Move page script moved page API GetTime to API GetTime without leaving a redirect)
 
(9 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<center>'''GetTime''' ''-Documentation by [[user:Zlixar|Zlixar]]-''</center>
{{wowapi}}__NOTOC__
When called, returns the current system uptime in seconds.
Returns the system uptime '''of your computer''' in seconds, with millisecond precision.
  seconds = GetTime();
  seconds = GetTime();
----
 
;''Arguments''
==Parameters==
===Arguments===


:''None''
:''None''
----
===Returns===
;''Returns''
:;seconds : Floating Point Number - The current system uptime in seconds.


:;seconds : Floating Point Number - The current system uptime in seconds.
==Example==
----
;''Example''
  seconds = GetTime();
  seconds = GetTime();
  print("Current system uptime is: "..seconds.." seconds!");
  print("Current system uptime is: "..seconds.." seconds!");
;''Result''
  Current system uptime is: 60123 seconds!
  > Current system uptime is: 60123.558 seconds!
----
 
;''Details''
==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 ^.^
:Contrary to what some believe, this does not return your current session time, time since launching the game, or time since the last patch. It returns the '''time since your own computer booted up'''.


{{Template:WoW API}}
:In Windows, this is acquired through the Windows kernel function [http://msdn.microsoft.com/en-us/library/ms724408.aspx GetTickCount()], divided by 1000.

Latest revision as of 04:46, 15 August 2023

WoW API < GetTime

Returns the system uptime of your computer in seconds, with millisecond precision.

seconds = GetTime();

Parameters[edit]

Arguments[edit]

None

Returns[edit]

seconds
Floating Point Number - The current system uptime in seconds.

Example[edit]

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

> Current system uptime is: 60123.558 seconds!

Details[edit]

Contrary to what some believe, this does not return your current session time, time since launching the game, or time since the last patch. It returns the time since your own computer booted up.
In Windows, this is acquired through the Windows kernel function GetTickCount(), divided by 1000.