BeCuriouzLearn something new every day
The 16-millisecond deadline your app can't miss
💡 Smooth mobile UI means finishing every frame within ~16ms on a single UI thread, so heavy work must be pushed off it.
Every smooth mobile UI is racing a hidden clock. A 60Hz display refreshes 60 times per second, which gives your app about 16.67 milliseconds to produce each frame. On a 120Hz screen that shrinks to roughly 8ms. Whatever your app needs to do to draw the next frame — measure layouts, run animations, composite views — must finish inside that window, or the display shows the old frame again. That repeated frame is called jank, and users perceive it as stutter or lag.
The catch is that UI work happens on a single privileged thread: the main thread on iOS, the UI thread on Android. This thread also handles touch input and runs your event callbacks. So if you parse a big JSON file, decode a bitmap, or do a slow database query on that thread, you steal time from frame rendering.
The fix is to keep the main thread lean: move heavy work to background threads (Kotlin coroutines, Dispatchers.IO, Task.detached, GCD queues) and only touch the UI thread to apply results. Tools like Android's Frame Profiler and Xcode's Instruments flag frames that blew the budget so you can find the culprit.