mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
test/latency: fix timediff calculation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
db7545a077
commit
eb3768563a
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
l = (signed long) t1.tv_usec - (signed long) t2.tv_usec;
|
||||||
if (l < 0) {
|
if (l < 0) {
|
||||||
t1.tv_sec--;
|
t1.tv_sec--;
|
||||||
l = -l;
|
l = 1000000 + l;
|
||||||
l %= 1000000;
|
l %= 1000000;
|
||||||
}
|
}
|
||||||
return (t1.tv_sec * 1000000) + l;
|
return (t1.tv_sec * 1000000) + l;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue