Linux has a concept of "control groups", aka cgroups for processes; each process belongs to one, and when we start a process for you, it, and any processes that it spawns, are put into a cgroup identified by your username. A cgroup keeps a log at kernel level of the number of CPU-nanoseconds that have been used by that group, based on the kernel's task scheduling records; we check it periodically, and store the value that it contains at that point then zero it out so that it starts counting again. (That in theory means that we might slightly undercount usage, because any CPU time used between when we check and when we zero it out will be ignored, but in practice that is small enough that it's a cost we're willing to take.) Then we aggregate those numbers across all of the servers where your code is running to come up with a total.
You're right that time.sleep(60)
will use a small amount of CPU resources, but it will be of the order of a few milliseconds at the most.