git-svn-id: svn://elaine/murooma/trunk@222 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-08-30 20:48:43 +00:00
parent c6dbf53a16
commit 42f27c328d
10 changed files with 289 additions and 234 deletions

View file

@ -62,6 +62,21 @@ static void addMs(timeval& tv, int ms)
tv.tv_usec %= 1000000;
}
static void addUs(timeval& tv, int us)
{
if (us < 0)
{
timeval t;
t.tv_sec = -us / 1000000;
t.tv_usec = (-us % 1000000);
timersub(&tv, &t, &tv);
return;
}
tv.tv_usec += us;
tv.tv_sec += (tv.tv_usec / 1000000);
tv.tv_usec %= 1000000;
}
static long getTickCount()