O'Reilly logo

Hands-On System Programming with Linux by Kaiwan N Billimoria

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

POSIX interval timers – example programs

Programming is ultimately learned and understanding is deeply internalized by doing, not simply seeing or reading. Let's take our own advice and cut a couple of decent code examples, to illustrate using the POSIX (interval) timer APIs. (Of course, dear reader, it implies you do the same!)

The first sample program is a small CLI game of "how quickly can you react"? The second sample program is a simple implementation of a run-walk timer. Read on for the gory details.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required