WoW:API GetTime: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Indentation Error.)
(Reformat. More clear documentation.)
Line 1: Line 1:
<center>'''GetTime''' ''-Documentation by [[user:Zlixar|Zlixar]], updated by [[user:Thorarin|Thorarin]]-''</center>
{{wowapi}}__NOTOC__
When called, returns the current system uptime in seconds, with millisecond precision.
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.558 seconds!
  > Current system uptime is: 60123.558 seconds!
----
;''Details''
: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 system uptime in seconds.


:In Windows, this is reported as the Windows kernel function [http://msdn.microsoft.com/library/en-us/sysinfo/base/gettickcount.asp GetTickCount()], divided by 1000.
==Details==
: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 gotten through the Windows kernel function [http://msdn.microsoft.com/library/en-us/sysinfo/base/gettickcount.asp GetTickCount()], divided by 1000.

Revision as of 20:39, 3 August 2006

WoW API < GetTime

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

seconds = GetTime();

Parameters

Arguments

None

Returns

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

Example

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

> Current system uptime is: 60123.558 seconds!

Details

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 gotten through the Windows kernel function GetTickCount(), divided by 1000.