Skip to main content

The "game_get_time" Function

Syntax#

game_get_time([type]);
ArgumentTypeDescription
[type]constantOptional: Sets whether to return a value in milliseconds (gamespeed_fps) or microseconds (gamespeed_microseconds) (use none for milliseconds)

Description#

Returns the number of milliseconds or microseconds the entire current game session has been running. If no [type] is specified, milliseconds will be returned by default.

Example#

var hours_played = floor(game_get_time(gamespeed_fps)/1000/60/60);
var ms_played = (game_get_time(gamespeed_microseconds)/100000);