How do I compare two timestamps in C?
I'm writing a socket program that maintains FIFO queues for two input sockets. When deciding which queue to service, the program pulls the most recent time-stamp from each queue. I need a reliable method for comparing two timeval structs. I tried using timercmp() , but my version of gcc doesn't support it, and documentation states that the function is not POSIX compliant. What should I do? googling timeval give this first result . From that page: It is often necessary to subtract two values of type struct timeval or struct timespec. Here is the best way to do this. It works even on some