Cygwin: Cleanup time handling
* Redefine NSPERSEC to NS100PERSEC * Define NSPERSEC as nanosecs per second * Define USPERSEC as microsecs per second * Use above constants throughout where appropriate * Rename to_us to timespec_to_us and inline * Rename it_bad to timespec_bad and inline Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -29,9 +29,9 @@ add_timeval (struct timeval *tv1, struct timeval *tv2)
|
||||
{
|
||||
tv1->tv_sec += tv2->tv_sec;
|
||||
tv1->tv_usec += tv2->tv_usec;
|
||||
if (tv1->tv_usec >= 1000000)
|
||||
if (tv1->tv_usec >= USPERSEC)
|
||||
{
|
||||
tv1->tv_usec -= 1000000;
|
||||
tv1->tv_usec -= USPERSEC;
|
||||
tv1->tv_sec++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user