Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
GlossaryNovember 22, 20263 min read

What is delta time?

Delta time is the number that keeps your game the same speed on every screen. Here is how to use it, where it breaks, and how to spot a game that forgot it.

Startbase Team
Editorial ink illustration of a brass stopwatch beside a small wind-up toy car, the second hand in ember orange

Key takeaways

  • Delta time (dt) is how long the previous frame took, usually in seconds: about 0.0167 at 60 fps and 0.0083 at 120 fps.
  • Multiply anything that changes over time by dt, so speeds are "per second" instead of "per frame".
  • Clamp it (0.05 to 0.1 seconds is a common cap) so a frozen tab or a hitch does not fling objects through walls.

Measured in seconds, delta time is how long passed between the previous frame and the current one, and games multiply movement, timers and animation by it so the game runs at the same speed whatever the frame rate. Without it, a game written on a 60 Hz laptop runs twice as fast on a 120 Hz phone.

An everyday version: if you walk 1.4 meters every second, how far you get depends on how long you walked, not on how many times you checked your watch. Delta time is the "how long" part. Check your watch 60 times a second or 120 times, the distance after one second is the same.

The math in one line

Inside the game loop, each frame computes dt from the clock, then every update uses it: `x += speed * dt`. If speed is 300 pixels per second, a 60 fps frame (dt about 0.0167) moves the player 5 pixels, and a 120 fps frame (dt about 0.0083) moves 2.5. After one second both have moved 300.

The same rule applies to everything that changes over time:

  • Velocity from acceleration: `vy += gravity * dt`, then `y += vy * dt`.
  • Timers: `cooldown -= dt`, and the dash is ready when it reaches zero.
  • Spin and fades: `angle += turnSpeed * dt`, `alpha -= fadeRate * dt`.
  • Smoothing: a camera that "closes 90% of the gap per second" uses an exponential form, `1 - Math.pow(0.1, dt)`, not a fixed fraction per frame.

Where delta time goes wrong

Multiplying by dt is not the whole story. Three traps show up again and again:

  1. 01Huge dt after a pause. Browsers stop the loop in background tabs. Come back after 20 seconds and the first dt is 20, so a falling player drops through the floor. Clamp dt to a maximum, 0.1 seconds is a common starting value.
  2. 02Jumps that vary by device. Simple per-frame integration of gravity gives slightly different jump heights at different frame rates. For precise platformers, run physics on a fixed timestep (for example 1/60 s) and let dt decide how many steps to run.
  3. 03Forgetting one thing. Movement uses dt but the enemy spawn timer counts frames, so waves arrive twice as often on fast screens. When something feels faster on one device, look for a counter that adds 1 per frame.

Delta time when building with Startbase

The agent writes movement with delta time by default, so you rarely see the variable. It matters when you test: if your dash covers a different distance on your phone than on your laptop, or a cooldown feels shorter on a gaming monitor, say so in those words. Tunable speeds can be exposed as dials in the Engine panel, and since they are per second, a value you set feels the same everywhere.

Check every timer, spawner and animation in the game: anything that counts frames should count seconds using delta time. Clamp delta time at 0.1 seconds, and run the player physics on a fixed 1/60 second step so jump height is identical on 60 Hz and 120 Hz screens.

Common confusions

  • Delta time vs frame rate. They are inverses: 60 fps means dt of about 16.7 ms. See frame rate (FPS).
  • Delta time vs lag. Network delay is latency, a different number. A smooth 60 fps game can still have 150 ms of ping in multiplayer.
  • Milliseconds vs seconds. requestAnimationFrame gives milliseconds. Mixing the two is a classic bug that makes everything 1,000 times too fast or too slow.

For movement built on these ideas, see top-down movement, and for keeping dt small and steady, game performance on phones.

Frequently asked questions

Should delta time be in seconds or milliseconds?

Either works if you are consistent, but seconds make tuning readable: a speed of 300 means 300 pixels per second. Convert the browser's milliseconds once, at the top of the loop.

Why does my game still feel different on a fast screen?

Usually something still counts frames, or gravity is integrated per frame. Move timers to seconds and put physics on a fixed timestep.

On this page

  • The math in one line
  • Where delta time goes wrong
  • Delta time when building with Startbase
  • Common confusions

Keep reading

More in Glossary
Editorial ink illustration of a hand-cranked music box drum plucking a metal comb, the crank handle in ember orange
GlossaryNovember 22, 2026

What is a game loop?

Every real-time game runs one repeating cycle: read input, update the world, draw it. Here is what that cycle looks like and why it decides how your game feels.

3 min read
Editorial ink illustration of a flip book riffling under a thumb with a running figure across its pages, the page edge in ember orange
GlossaryNovember 22, 2026

What is frame rate (FPS)?

FPS counts the pictures a game draws per second. Here is what the numbers mean in milliseconds, why a steady 60 beats a jumpy 90, and what drags a phone game down.

3 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.