mirror of
https://gitee.com/openharmony/third_party_alsa-lib
synced 2024-11-30 11:10:49 +00:00
test/latency: fix timediff calculation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
db7545a077
commit
eb3768563a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user