Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your Timer Is a Wall Clock, Not a Stopwatch: Four Elapsed-Time Myths and a Monotonic Probe

How long did that batch job take? Simple question. Your logs probably answer it wrong. I kept seeing two numbers for one run. The job log said eleven minutes. The dashboard said forty-two. Neither was lying. They were reading different clocks. So here is the myth-busting FAQ I wish I had read first. Four claims developers repeat. Evidence for each. And one probe you can run in ten minutes. The…

How long did that batch job take? Simple question. Your logs probably answer it wrong. Two numbers for one run appeared in the job log and dashboard. Neither was lying. They were reading different clocks. The following FAQ will debunk four common claims about elapsed time and provide a ten-minute probe to test the hypothesis.

The setup is straightforward: a single job calling a model once per input and generating a JSONL report.

Myth 1: time.time() minus time.time() is a duration. Everyone does this, but it's wrong. Wall clock represents what time it is, not how long a task took. Subtraction of two wall readings can yield negative numbers or include time not spent. Linux users can check NTP sync, adjustment, chrony offset and slew rate, and seconds since boot using timedatectl, chronyc tracking, and /proc/uptime. The monotonic clock, which never goes backward, should be used for measuring durations.

Myth 2: If your timer jumped, the host slept. This may be true, but it's not the only possibility. Gaps in monotonic time indicate the process did not run; it doesn't reveal the cause. Possible reasons include throttling, preemption, host suspension, or I/O blockage. To identify the issue, log both wall and monotonic clocks side by side and compare the differences.

Myth 3: A timeout means the request failed. It doesn't. A timeout is a local observation about your side of the socket and provides no information about the remote side. The remote work might have completed after you gave up. Blindly retrying can lead to duplicate results, writes, or charges. To avoid this, derive a dedupe key from the request, not the clock. Log the key before and after the call, and persist it to disk for identifying reruns versus new units of work.

Myth 4: Retries are free because the model is free. This is incorrect. Free is a price, not a property of your runtime. Every retry consumes wall time, which is your actual budget. Three retries can consume significant time, impacting your overall performance.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Meet LiveReview: Auto Approve 30-50% of Your Low-Risk PRs, Safely

Earlier this year, we built a small tool called git-lrc . It fixed one problem: engineers committing AI-written code they had not read.

  • LiveReview auto-approves 30-50% low-risk PRs
  • System uses semantic LLM, custom ML, static analysis
  • Provides checkpoints for custom risk enforcement

Drafting Rights: Assign Every Doc Section to a Model or a Named Human

Most documentation pipelines fail on accountability rather than prose quality, because nobody can point at a sentence and name the human who approved it.

  • Models can draft only current behavior sections
  • Future functionality promises prohibited for models
  • Manifest file docs-rights.yml enforces tiers

Python: Call Multiple APIs in Parallel with asyncio.gather and Semaphore in 10 Minutes

When you need to call dozens of APIs — syncing data, crawling prices, firing webhooks — a sequential for loop adds up the waiting time of every request: 20 requests × 1 second = 20 seconds.

  • asyncio.gather enables concurrent execution of coroutines in a single event loop.
  • Semaphore limits concurrent requests to avoid overwhelming partner APIs.
  • Using returnexceptions=True allows handling of errors while returning a list of results.

More from Saturday 7 November →