diff options
author | px4dev <px4@purgatory.org> | 2013-01-14 10:08:47 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-01-14 10:08:47 -0800 |
commit | c38ad4ded570eddadeeca3579d02dfc63dcc8a9d (patch) | |
tree | be134f68c219d4703fec315ac0714e76854523ed /apps/px4/tests/test_time.c | |
parent | b5d3d8e436b5ba6415198b6ecd60185dceeccb18 (diff) | |
download | px4-firmware-c38ad4ded570eddadeeca3579d02dfc63dcc8a9d.tar.gz px4-firmware-c38ad4ded570eddadeeca3579d02dfc63dcc8a9d.tar.bz2 px4-firmware-c38ad4ded570eddadeeca3579d02dfc63dcc8a9d.zip |
Fix the 'time' test, now that rand() seems to be working.
Diffstat (limited to 'apps/px4/tests/test_time.c')
-rw-r--r-- | apps/px4/tests/test_time.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/px4/tests/test_time.c b/apps/px4/tests/test_time.c index 25bf02c31..8a164f3fc 100644 --- a/apps/px4/tests/test_time.c +++ b/apps/px4/tests/test_time.c @@ -95,7 +95,7 @@ cycletime(void) lasttime = cycles; - return (basetime + cycles) / 168; + return (basetime + cycles) / 168; /* XXX magic number */ } /**************************************************************************** @@ -133,9 +133,9 @@ int test_time(int argc, char *argv[]) lowdelta = abs(delta / 100); /* loop checking the time */ - for (unsigned i = 0; i < 100000; i++) { + for (unsigned i = 0; i < 100; i++) { - usleep(rand() * 10); + usleep(rand()); uint32_t flags = irqsave(); @@ -154,7 +154,7 @@ int test_time(int argc, char *argv[]) fprintf(stderr, "h %llu c %llu d %lld\n", h, c, delta - lowdelta); } - printf("Maximum jitter %lld\n", maxdelta); + printf("Maximum jitter %lldus\n", maxdelta); return 0; } |