Policies Are Agreed in Minutes, Config Files Want Milliseconds
Nobody writes a ticket asking for a 900 000 ms session timeout. The decision arrives as "log people out after fifteen minutes", "give the upstream five seconds", "cache it for five minutes" — and then somebody has to type an integer into a YAML file, an environment variable or a client builder that counts in milliseconds. The translation is trivial arithmetic and a surprisingly common source of outages, because a value that is wrong by a factor of a thousand still looks like a perfectly reasonable number.
Where the Millisecond Integers Show Up
Timers in the runtime
setTimeout and setInterval take a millisecond delay and nothing else, so every scheduled poll, debounce and keep-alive in a browser or Node service is expressed there.Client and connection timeouts
Cache lifetimes and token windows
Retry and backoff schedules
Turning an Agreed Interval Into a Config Value
Two directions get used constantly: writing a new value, and working out what an existing integer in somebody else's file actually means.
Enter the interval as it was agreed
Put 15, 5, 0.5 or 1440 in the minutes field. Fractions are fine for sub-minute values, and a comma is accepted in place of a dot, so 2,5 and 2.5 both give 150 000.
Count the zeros before you commit it
Thousands are separated with a space in the output, so 900 000 is legible at a glance rather than a run of digits you have to count twice in a code review.
Reverse it to audit an existing file
The swap button (↔) runs ms → min, which is how you find out that the 1 800 000 someone committed last year is half an hour and the 18 000 next to it is eighteen seconds.
Copy the bare integer into the field
The copy control on each side gives you digits only — no unit suffix, no separators — which is exactly what a YAML scalar or an environment variable needs. Ctrl + C in the field does the same.
Seconds will read 900 000 as ten and a half days, and a millisecond setting will read 900 as under a second. A pasted number is only correct together with the field it lands in.Intervals You Will Actually Type Into a Config File
The durations that turn up again and again in service configuration, with the integer each one becomes and the setting it usually belongs to.
| Interval | Minutes | Milliseconds | Where it usually lands |
|---|---|---|---|
| 30 seconds | 0.5 | 30 000 | Liveness probe period, HTTP read deadline |
| 1 minute | 1 | 60 000 | Metrics scrape interval, short-lived cache entry |
| 5 minutes | 5 | 300 000 | Config refresh, feature-flag poll |
| 10 minutes | 10 | 600 000 | Background reconciliation loop |
| 15 minutes | 15 | 900 000 | Idle session timeout |
| 30 minutes | 30 | 1 800 000 | Access-token lifetime, lock lease |
| 1 hour | 60 | 3 600 000 | Long cache lifetime, key rotation window |
| 1 day | 1 440 | 86 400 000 | Nightly cleanup, log retention tick |
| 7 days | 10 080 | 604 800 000 | Refresh-credential lifetime |
| Timer ceiling | 35 791.394 | 2 147 483 647 | Largest delay a 32-bit timer can hold |
Everything above the day row is where the trouble starts. Once a duration is measured in weeks the millisecond integer runs to nine digits, and the last row is a hard wall rather than a suggestion.
What Makes This Useful During a Config Review
Both boxes accept a config value
Type a policy in minutes on the left or paste a suspicious integer on the right; whichever side you touch drives the other, so an audit and an edit use the same screen.
Decode a stray 300000 in one press
The swap arrows put milliseconds on the left, the direction you want when reviewing a diff full of long integers nobody has commented.
Seconds, hours and days share the dropdown
Searchable unit lists on both sides mean the same page answers "how many seconds is that" for a setting whose name ends in Seconds, without opening anything else.
Long integers stay countable
Thousands are spaced in the output and stray spaces in your input are ignored, so you can paste 604 800 000 back in from a table without cleaning it first.
Questions That Come Up in Code Review
What do I put in the config for a 15-minute session timeout?
900 000 if the setting is in milliseconds, 900 if it is in seconds, and 15 if the library parses a duration string such as 15m. All three are the same policy, and all three look plausible in the wrong slot — 900 milliseconds logs everyone out almost immediately, while 900 000 seconds keeps a session alive for ten and a half days. Confirm the unit from the documentation, not from the shape of the number.
How do I tell whether a library wants seconds or milliseconds?
Three signals, in order of reliability. First, the name: anything ending in Seconds or Millis has told you outright, and Kubernetes probe fields follow this convention throughout. Second, the type: a language-level duration type such as Go's time.Duration or Java's Duration carries its own unit, so you never write a bare integer. Third, protocol convention: HTTP header directives are defined in seconds by the spec, while runtime timer APIs are almost always in milliseconds. When none of that settles it, set an obviously short value in a test environment and watch what actually expires.
What happens if a timer delay goes past 2,147,483,647 ms?
It fires straight away instead of waiting. Browser and Node timers hold the delay in a signed 32-bit integer, whose maximum is 2 147 483 647 ms — 35 791.394 minutes, or about 24.855 days. Anything larger overflows and the callback runs on the next tick, which is why a scheduler asked to wait 30 days silently does its work immediately and then thinks the window has passed. For horizons beyond three weeks, chain shorter timers or store the target moment and re-arm a timer each time the process starts.
Where should an exponential backoff stop doubling?
Two ceilings, not one. Cap the individual delay somewhere between 20 000 and 60 000 ms — starting at 100 ms and doubling, you reach 25 600 ms on the ninth attempt, and waiting longer than a minute between tries rarely helps anyone. Then cap the total: a retry budget of 2 minutes is 120 000 ms, and once the clock passes it the call should fail rather than keep going. Multiply each delay by a random factor as well, so a thousand clients that failed together do not all come back at the same instant.
Should a five-minute cache TTL be written 300 or 300000?
It depends which cache. An HTTP Cache-Control: max-age directive is defined in seconds, so it is 300 and a 300000 there would promise browsers three and a half days. An in-process or client-side cache written against a timer usually takes 300 000 ms. Key–value stores frequently offer both — one command in seconds, another in milliseconds — with the unit encoded in the command name. Same policy, three different integers, and the only safe habit is to read the unit before typing the value.
No comments yet. Be the first to comment!