Changeset 387


Ignore:
Timestamp:
Apr 5, 2006 7:04:34 PM (19 years ago)
Author:
bennylp
Message:

Don't use rdtsc for high res timestamp on Linux as it's highly inaccurate (for now)

Location:
pjproject/trunk/pjlib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/os_timestamp_linux.c

    r66 r387  
    2424#include <ctype.h> 
    2525 
    26 #if defined(PJ_HAS_PENTIUM) && PJ_HAS_PENTIUM!=0 
     26#if defined(PJ_HAS_PENTIUM) && PJ_HAS_PENTIUM!=0 && \ 
     27    defined(PJ_TIMESTAMP_USE_RDTSC) && PJ_TIMESTAMP_USE_RDTSC!=0 && \ 
     28    defined(PJ_M_I386) && PJ_M_I386!=0 && \ 
     29    defined(PJ_LINUX) && PJ_LINUX!=0 
    2730static int machine_speed_mhz; 
    2831static pj_timestamp machine_speed; 
  • pjproject/trunk/pjlib/src/pjlib-test/timestamp.c

    r386 r387  
    100100                             (pj_uint32_t)(diff * 1000000 / freq.u64),  
    101101                             msec)); 
     102    } else { 
     103        PJ_LOG(3,(THIS_FILE, "....good. Timestamp is accurate down to" 
     104                             " nearest usec.")); 
    102105    } 
    103106 
Note: See TracChangeset for help on using the changeset viewer.