Changeset 149 for trunk/src/time.cc


Ignore:
Timestamp:
07/07/13 17:34:37 (12 years ago)
Author:
epyon
Message:
  • time - choice of uint32/uint64 depending on requested precision in both functions and template util classes
  • md3_loader - severe performance improvements
  • md3_loader - tag transform array loading
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/time.cc

    r121 r149  
    6767}
    6868
    69 nv::uint32 nv::get_cpu_us()
     69nv::uint64 nv::get_cpu_us()
    7070{
    71         return (uint32)( (f32)( clock() - zero_timer.clock_zero ) / ( (f32)CLOCKS_PER_SEC / 1000000.0 ) ) ;
     71        return (uint64)( (f32)( clock() - zero_timer.clock_zero ) / ( (f32)CLOCKS_PER_SEC / 1000000.0 ) ) ;
    7272}
    7373
     
    7878        QueryPerformanceCounter(&now);
    7979        LONGLONG result = now.QuadPart - zero_timer.query_zero.QuadPart;
    80         return (uint32) (1000.0 * result / zero_timer.frequency.QuadPart);
     80        return (uint32) (1000.0 * result / (double) zero_timer.frequency.QuadPart);
    8181#else
    8282        struct timeval now;
     
    8686}
    8787
    88 nv::uint32 nv::get_system_us()
     88nv::uint64 nv::get_system_us()
    8989{
    9090#if NV_COMPILER == NV_MSVC
     
    9292        QueryPerformanceCounter(&now);
    9393        LONGLONG result = now.QuadPart - zero_timer.query_zero.QuadPart;
    94         return (uint32) (1000000.0 * result / zero_timer.frequency.QuadPart);
     94        return (uint64) (1000000.0 * result / (double) zero_timer.frequency.QuadPart);
    9595#else
    9696        struct timeval now;
Note: See TracChangeset for help on using the changeset viewer.