Library os

GLua's os library.

Functions

clock() Returns the current CPU clock time.
date( format, time ) Returns the date corresponding to the given timestamp, formatted using a specified format.
difftime( endTime, startTime ) Returns the difference between the two given timestamps.
time( date ) Returns the current UNIX timestamp in seconds.


Functions

os.clock()
Returns the current CPU clock time. Unlike other time measurements, this increments only when actual CPU work is performed, but has relatively low precision.

Environment:

Shared
os.date( format, time )
Returns the date corresponding to the given timestamp, formatted using a specified format. See PIL for the supported formatting options.

Environment:

Shared

Parameters:

  • (string) format: The format to use to output the date ("*t" outputs a Date structure).
  • (number?) time: An optional timestamp to use (default = os.time()).
os.difftime( endTime, startTime )
Returns the difference between the two given timestamps.

Environment:

Shared

Parameters:

  • (number) endTime: The timestamp to subtract from.
  • (number) startTime: The timestamp to subtract.
os.time( date )
Returns the current UNIX timestamp in seconds.

Environment:

Shared

Parameters:

  • (Date?) date: An optional date to get the timestamp for.

Valid XHTML 1.0!