I have a program that generally makes around 100+ connections, every data that arrives in these connection is somehow analyzed. For the analyzing I need around 4 timers in these connecitons for different events. I need these timers because if a specific event on the connection hasn't occured for a specified time, I need to raise a flag. All those connections are in different threads. The current solution that I use is for every "timer" to mark that the event has occured at specific time by gettimeofday system call, and then every iteration to check if the current vallue of gettimeofday differes by a specific amount of time. However I discovered that gettimeofday is called way to often this way. Calls to gettimeofday take around 80% of execution time and makes my program unacceptably inefficient. I want to make the same thing in other mechanism. I've read a little about timer functions in posix, but would it be more efficient when I must reset the timer quite often in nomral operation? Has anyone encountered such a problem?