diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-05-10 19:24:40 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-05-10 19:24:40 +0000 |
commit | 50a501dbe89ec8f9a76540015890dd361f1ec8a1 (patch) | |
tree | a45dac4292320647ed297b35239fccf38eb5885b /pjlib/src/pjlib-test/timestamp.c | |
parent | 5f10c756ac9d5f48efe2adbcccf5d54634540d61 (diff) |
Merge-in RTEMS port patch by Phil Torre <ptorre@zetron.com>, alpha release.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@433 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pjlib-test/timestamp.c')
-rw-r--r-- | pjlib/src/pjlib-test/timestamp.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/pjlib/src/pjlib-test/timestamp.c b/pjlib/src/pjlib-test/timestamp.c index 48435406..f7ff7874 100644 --- a/pjlib/src/pjlib-test/timestamp.c +++ b/pjlib/src/pjlib-test/timestamp.c @@ -188,8 +188,14 @@ int timestamp_test(void) } /* Loop.. */ - for (i=0; i<1000000; ++i) - ; + for (i=0; i<1000000; ++i) { + /* Try to do something so that smart compilers wont + * remove this silly loop. + */ + null_func(); + } + + sleep(0); /* Mark end time. */ pj_get_timestamp(&t2); @@ -198,8 +204,10 @@ int timestamp_test(void) elapsed = pj_elapsed_usec(&t1, &t2); PJ_LOG(3,(THIS_FILE, "....elapsed: %u usec", (unsigned)elapsed)); - /* See if elapsed time is reasonable. */ - if (elapsed < 1 || elapsed > 100000) { + /* See if elapsed time is "reasonable". + * This should be good even on 50Mhz embedded powerpc. + */ + if (elapsed < 1 || elapsed > 1000000) { PJ_LOG(3,(THIS_FILE, "....error: elapsed time outside window (%u, " "t1.u32.hi=%u, t1.u32.lo=%u, " "t2.u32.hi=%u, t2.u32.lo=%u)", |