That's one thing that's really nice about Cloudflare workers, you're billed on CPU time, not duration, so you can happily make slow requests to other services.
The above tracking method works for containerized things. For virtualized things, it’s different: When a Linux system has nothing to do (all processes sleeping or waiting), the kernel puts the CPU to sleep. The kernel will eventually be woken by an interrupt from something, at which point things continue. In a virtualized environment, the hypervisor can measure how long the entire VM is running or sleeping.
https://blog.cloudflare.com/cloud-computing-without-containe...