ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
shared

GetGameTimer

FiveM shared native documentation with a Lua example.

Summary

Returns the milliseconds since the game/server started. Used for cooldowns, timing, and measuring durations.

Returns

number — milliseconds.

Example

local start = GetGameTimer()
-- ... do work
local elapsed = GetGameTimer() - start

-- cooldown
if GetGameTimer() - lastUse > 5000 then lastUse = GetGameTimer() end

Common pitfalls

  • It's relative uptime, not real-world time — use os.time() for wall-clock.
  • Great for lightweight cooldowns without timers.

Related natives

Related guides

FiveM scripts done right

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.

Browse Scripts →