aboutsummaryrefslogtreecommitdiff
path: root/tests/time/src.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/time/src.c')
-rw-r--r--tests/time/src.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/time/src.c b/tests/time/src.c
index 3d4da4c2..94eb6a3f 100644
--- a/tests/time/src.c
+++ b/tests/time/src.c
@@ -91,10 +91,13 @@ int main() {
asctime_r(tm_ptr, buffer);
printf("old asctime again: %s", formatted);
- // Verify that clock() is initially 0 and doesn't crash.
- printf("clock: %d\n", clock());
+ // Verify that clock() advances.
+ clock_t start = clock();
+ printf("clock(start): %d\n", start >= 0);
+ while (clock() - start < 50000); // Poor man's sleep().
+ printf("clock(end): %d\n", clock() - start >= 50000);
- // Verify that ctime_r(x, buf) is equivalent to asctime_r(localtime(x), buf2).
+ // Verify that ctime_r(x, buf) is equivalent to asctime_r(localtime(x), buf).
time_t t7 = time(0);
char buffer2[30];
char buffer3[30];