commit b52667cdb794000f53c19e7055878bc0850f5acd
parent ceba9e9fa10db6fce6b270de7a803a9734337002
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 23 Apr 2026 06:55:31 +0200
tests/libc: Use seconds for the difftime check
Difftime returns the difference in seconds between two time_t
so it makes more sense to wait until the difference is at least
one second.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/libc/execute/0070-difftime.c b/tests/libc/execute/0070-difftime.c
@@ -15,7 +15,7 @@ test(void)
double d1, d2;
time_t t1, t2;
- for (t1 = t2 = time(NULL); difftime(t1, t2) < 0.005; t2 = time(NULL))
+ for (t1 = t2 = time(NULL); difftime(t1, t2) < 1; t2 = time(NULL))
;
d1 = difftime(t1, t2);