From eb3768563a29189156b7117d975930aee8133586 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 4 Aug 2010 19:47:01 +0200 Subject: [PATCH] test/latency: fix timediff calculation Signed-off-by: Jaroslav Kysela --- test/latency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/latency.c b/test/latency.c index 304e0126..03d65a23 100644 --- a/test/latency.c +++ b/test/latency.c @@ -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; -- 2.47.1