Changeset 149 for trunk/src/time.cc
- Timestamp:
- 07/07/13 17:34:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/time.cc
r121 r149 67 67 } 68 68 69 nv::uint 32nv::get_cpu_us()69 nv::uint64 nv::get_cpu_us() 70 70 { 71 return (uint 32)( (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 ) ) ; 72 72 } 73 73 … … 78 78 QueryPerformanceCounter(&now); 79 79 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); 81 81 #else 82 82 struct timeval now; … … 86 86 } 87 87 88 nv::uint 32nv::get_system_us()88 nv::uint64 nv::get_system_us() 89 89 { 90 90 #if NV_COMPILER == NV_MSVC … … 92 92 QueryPerformanceCounter(&now); 93 93 LONGLONG result = now.QuadPart - zero_timer.query_zero.QuadPart; 94 return (uint 32) (1000000.0 * result /zero_timer.frequency.QuadPart);94 return (uint64) (1000000.0 * result / (double) zero_timer.frequency.QuadPart); 95 95 #else 96 96 struct timeval now;
Note: See TracChangeset
for help on using the changeset viewer.