linux-sysprog · beginner · ~15 min
Detect a timeout from timestamps.
Implement int timed_out(long start, long now, long timeout) returning 1 if now - start >= timeout, else 0.
int timed_out(long start, long now, long timeout) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.