1 second is a long time

1 minute read

In the life of a computer.

Often times when writing a test program that needs to output something in a loop, I make it sleep for one second to “spare” my computer from an unhinged workload. I constantly need to remind myself that in the life of a computer, a second is a terribly long time. For example, the laptop I’m using now has a max clock speed of 4 GHz. That is 4 billion clock cycles per second. And computers do work on a per cycle basis, so 1 second is an eternity. It may as well be the afterlife after a live well lived.

To put it into further context, let’s take a look at this diagram from Systems Performance by Brendan Gregg. In this imaginary scale 1 CPU cycle is scaled to 1 second. From that view, we can see 1 second in a computer is 105 years of human time.

There’s no real moral of the story here other than, your computer is powerful and can do a lot of work. Don’t be afraid to put it to the test.

cpu cycle speed