test/latency: fix timediff calculation

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2010-08-04 19:47:01 +02:00
parent db7545a077
commit eb3768563a

View File

@ -321,7 +321,7 @@ long timediff(snd_timestamp_t t1, snd_timestamp_t t2)
l = (signed long) t1.tv_usec - (signed long) t2.tv_usec;
if (l < 0) {
t1.tv_sec--;
l = -l;
l = 1000000 + l;
l %= 1000000;
}
return (t1.tv_sec * 1000000) + l;