Why computers still struggle to tell the time

As more industries demand sub-second accuracy, computers struggle to maintain precise time

While computers manage many things with extreme precision, they have surprising difficulty keeping track of time.

It's pretty much impossible for a computer to keep exact time, although accuracy can be improved to the extent that users are willing to spend more money on the problem, said George Neville-Neil, who spoke at the Association for Computing Machinery's Applicative conference in New York last week.

"There are so many variables in trying to get time better or close to right," he said.

Neville-Neil is a software engineer who helps financial institutions and other time-sensitive organizations maintain ultra-precise measurements of time. He works on the Precision Time Protocol (PTP), an IEEE standard for relaying the time over a network with greater accuracy than the industry standard Network Time Protocol (NTP).

A computer clock can be thrown off by many factors, including network jitter, delays introduced by software, and even the environmental conditions in which the computer is operating.

To keep internal time, computers use a crystal oscillator that creates an electromagnetic signal, or a vibration that the computer uses to coordinate processor, memory, bus and motherboard operations.

But computer makers often use inexpensive crystals costing only a few cents each, which can compromise accuracy. "If you buy server-class hardware, you will get cheap crystal, and time will wander if you don't do something about it," Neville-Neil said.

As crystals age, their frequencies drift. The workload on a system can also affect a crystal's output: the more work a system does, the hotter it gets, and the heat causes the crystal vibrations to increase in frequency.

The average crystal ends up being about as accurate as a mechanical watch, meaning both can skew faster or slower over time at about the same rate. You're shiny new iPhone has about the same time accuracy as a good mechanical watch built decades ago, according to Neville-Neil.

He tested his own laptop against an expensive precision clock and found his computer had drifted off by 15 milliseconds within two hours. "This is typical behavior," he said.

Most end-users wouldn't notice such small discrepancies, but increasingly some computer systems require high precision.

Distributed systems, which harness multiple servers to work on a single task, require the computers be synchronized on the same time. Debugging distributed systems requires understanding an temporal order of events as they unfurl across different nodes.

Robotic systems also require precise time, to calibrate motions of their moving parts. Power companies use time to control the frequency of the alternating current delivered to customers; U.S. power grids need time to be counted out 60 times a second, for instance.

The base stations for next-generation LTE (Long-Term Evolution) cellular networks need to synchronize their operations within 1,100 nanoseconds. And in the financial world, high frequency trading requires precise measurements, as automated traders vie to complete orders in milliseconds.

Of course, most servers can get outside help, by synchronizing over the Internet from one of the world's official time keepers, such as the U.S. Naval Observatory or the National Institute of Standards and Technology.

Getting the correct time from the Internet also has pitfalls, though. A NIST server could spit out a message with the exact time, but there's a slight lag before that message gets back to the server sending the request. Server software can estimate how long the messages will take to get through the network, but each trip may vary depending on congestion.

By default, NTP, used by most servers for time synchronization, polls a master clock once every 64 seconds, a frequency that can only be increased to about every 15 seconds, limiting accuracy.

NTP also has difficulty maintaining accuracy in virtualized cloud environments, often for mysterious reasons. "Getting accurate time out of virtual machines is something that has plagued all of the virtual machine providers," Neville-Neil said. VMware has worked on improving the time accuracy of its virtual machines, though for many general use cloud providers, such as Amazon, exact time measurement remains a challenge.

Even when checking an outside master clock, computer software will introduce additional distortions. The operating system typically digests network packets in batches, delaying time packets. And the software for managing time may be pushed down the processing queue in favor of other jobs.

Precision Time Protocol, the IEEE standard, was developed to offer servers even greater accuracy. It's used by the financial industry, the power industry and telecommunications companies.

There is no magic that makes PTP more accurate than NTP, other than the fact that it polls a master clock more often, Neville-Neil said. PTP can check a master source every second, for those organizations willing to allocate more network bandwidth. Using multicasting, all the servers see the same time packet at the same time.

"You can always build a more accurate time system, though it generally costs an order of magnitude more money per accuracy level," Neville-Neil said.

Joab Jackson covers enterprise software and general technology breaking news for The IDG News Service. Follow Joab on Twitter at @Joab_Jackson. Joab's e-mail address is Joab_Jackson@idg.com

Join the Good Gear Guide newsletter!

Error: Please check your email address.

Tags Development toolsapplication developmentsoftware

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Joab Jackson

IDG News Service
Show Comments

Essentials

Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >

Mobile

Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >

Exec

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

HD Pan/Tilt Wi-Fi Camera with Night Vision NC450

Learn more >

Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards 

Learn more >

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >

Budget

Back To Business Guide

Click for more ›

Most Popular Reviews

Latest News Articles

Resources

PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?