Frame times, response times and timer output

Game engines, graphics tools and web performance panels measure work in nanoseconds or very small fractions of a second, while the numbers that people discuss are milliseconds. A frame that takes 16,666,667 ns to produce is a 16.67 ms frame. A page request logged at 250,000,000 ns took 250 ms. Dividing by one million is simple on paper but hard to do reliably when a figure has nine digits. This page performs that division and shows the result in ms, so developers, testers and students can compare a raw timer value with a budget written in milliseconds, such as a target for how long an action may take before a user notices a delay.

4,500,000 ns as 4.5 ms by hand

A millisecond is 10^-3 s and a nanosecond is 10^-9 s, so a millisecond holds 1,000,000 nanoseconds. The formula is ms = ns × 0.000001. The factor is exact because the prefixes are powers of ten defined in the SI Brochure and listed in NIST SP 811. By hand the decimal point moves six places to the left: 4,500,000 ns is 4.5 ms and 250,000 ns is 0.25 ms. A quick consistency check goes through the microsecond, since 1,000 ns is 1 µs and 1,000 µs is 1 ms. If the digits on the page look the same as your input with the point moved, the work is right, and any other pattern points to a wrong unit selection.

Ten nanoseconds against a millisecond budget

The default of 10 ns returns 0.00001 ms. That is one hundred-thousandth of a millisecond, a reminder that a millisecond is long on the scale of processor operations. Even 250,000 ns, a quarter of a millisecond, is the same as 250 µs. A function that takes 3,200 ns to run is 0.0032 ms, so you could call it more than 5,000 times inside a 16.67 ms frame before you used up the budget, assuming nothing else takes time. The page handles the unit change, and the budget arithmetic is yours to check with the numbers from your own profile. Show enough decimals that a small value does not round to zero.

Sixty frames a second and what each one allows

A display refreshing at 60 Hz shows a new frame every 1 ÷ 60 s, or about 16.6667 ms, which is 16,666,667 ns. At 120 Hz the frame lasts 8.3333 ms, or 8,333,333 ns. At 30 Hz it lasts 33.33 ms. If a render pass reports 12,400,000 ns, the page converts it to 12.4 ms, which fits inside a 60 Hz frame with 4.27 ms to spare, though not inside a 120 Hz frame. These numbers explain why graphics programmers talk in milliseconds. The page does not know the refresh rate of your display or the cost of the rest of the pipeline, so it only gives the pass duration in the unit of the budget.

Latency from tools and logs

Network tools such as ping report round-trip times in milliseconds, whereas packet captures and kernel tracing tools can stamp events in nanoseconds. Matching a capture to a ping result needs a conversion. A request and reply separated by 24,300,000 ns in a capture show up as 24.3 ms in the tool, which agrees with a ping of about that size. Database slow-query logs and application traces vary in their units too, and mixing them in one chart without a conversion can hide a performance problem. Check each column header, convert everything to ms with the page and plot the values together on a single axis before you reach conclusions.

Audio buffers and the delay you hear

Audio software lets you set a buffer size, and the delay it adds is often shown in milliseconds. A buffer of 256 samples at 48,000 Hz lasts 5.3333 ms, which is 5,333,333 ns. A 64-sample buffer lasts 1.3333 ms. Players and musicians often notice latency once the total round trip passes roughly 10 ms, though the threshold depends on the instrument and the person. Converting an interface specification from ns to ms lets you add up the pieces of a signal chain in one unit. The page does not know your drivers or converters, so measure the real loopback delay of your setup if it matters for recording.

Keeping fractions of a millisecond

Rounding a short interval to a whole number of milliseconds can throw away the very detail you wanted. A step that takes 740,000 ns is 0.74 ms, and rounding it to 1 ms overstates its cost by more than a third. Ten such steps would show 10 ms in a rounded table instead of 7.4 ms. Keep two or three decimals while you work, and round once at the end. If a value comes back as 0.00001 ms, change the unit to microseconds or nanoseconds for the report, because a number with five leading zeros is easy to misread. Graph axes labeled in ms should have a tick spacing that fits the range of the data.

Reading a timer correctly

The converter assumes that the value you enter is a duration already. Many programming interfaces return a timestamp from a counter that started at boot or at an epoch, and you have to subtract the start value before converting. Timers also differ in resolution: some tick only every several hundred nanoseconds, or even every millisecond, so a result with seven digits may not have seven digits of meaning. Run the measured code many times and use the median or a percentile instead of one reading. The page contributes an exact unit change and leaves the quality of the measurement to your method.

Averages and medians survive the unit change

Dividing every sample by one million scales the mean, the median and any percentile by the same factor, so it makes no difference whether you convert first or last. Take three timings of 4,000,000 ns, 6,000,000 ns and 11,000,000 ns. Their mean is 7,000,000 ns, which is 7 ms, and their median is 6,000,000 ns, or 6 ms. The gap between them shows a slow outlier pulling the mean up. Converting the column once with the page and then summarizing is fine, and so is the reverse order. Keep the raw nanosecond data in the file you share, because someone else may want to recompute a percentile, and a rounded millisecond column cannot be turned back into the original values.