HomeBlogFiveM Performance: What 0ms Idle Actually Means
TECHTechnical

FiveM Performance: What 0ms Idle Actually Means

March 8, 2026
·
5 min read

Every 0BugScripts resource ships with 0ms idle performance. It's a claim we make on every product page — here's exactly what that means and how we achieve it.

The Basics: How FiveM Measures Performance

FiveM reports resource performance in milliseconds per frame. You can check this in-game with:

code
/resmon

Two numbers matter: server ms and client ms. At idle — meaning no players are actively using the feature — both should be at or near 0.00ms.

A script that polls every frame to check conditions will show a non-zero idle cost even when nobody is using it. Multiply that across 20-30 resources and you're losing meaningful tick budget.

Event-Driven vs Polling

The most common source of wasted performance is a Citizen.CreateThread loop running every frame with no conditional:

lua
-- Bad: runs every frame, always Citizen.CreateThread(function() while true do Citizen.Wait(0) -- check something... end end)

The correct pattern is to only poll when something is actively happening, and sleep aggressively otherwise:

lua
-- Good: sleeps until triggered local isActive = false Citizen.CreateThread(function() while true do Citizen.Wait(isActive and 0 or 500) if isActive then -- do frame work end end end)

At idle (isActive = false), this thread wakes twice per second instead of 60 times. The resource monitor reads 0.00ms because the per-frame cost is effectively zero.

Network: NUI and Events

Client↔Server round trips are expensive when done naively. Keep in mind:

  • Use state bags for data that multiple clients need passively
  • Batch event calls instead of firing one per entity
  • Rate-limit NUI callbacks — don't call the server on every keypress

What We Do Differently

Every 0BugScripts resource is profiled before release. We target:

  • 0.00ms idle on both client and server
  • < 0.05ms active (while a player is in an active interaction)
  • No polling threads that run without a trigger

The config file also lets you tune tick rates for any loops that do need to run, so you can adapt to your server's specific workload.


If you're running /resmon and seeing a resource holding above 0.05ms at idle, open a ticket in Discord. That's a bug, not a feature.