This chapter covers:
- how a computer keeps time
- how operating systems represent timestamps
- synchronize with the world’s atomic clocks with the Network Time Protocol (NTP)
During this chapter, you’ll be producing an NTP client that can request the current time from the world’s network of public time servers. It’s a fully-functioning client that can be included into your own computer’s boot process to keep it in sync with the world.
Understanding of how time works within computers supports your efforts to build resilient applications. The system’s clock jumps both backwards and forwards in time. Knowing why this happens will allow you to anticipate and prepare for that eventuality.
Your computer also contains multiple physical and virtual clocks. It takes some knowledge to understand the limitations of each and when they’re appropriate. Understanding the limitations of each should foster a healthy skepticism of micro benchmarks and other time-sensitive code.