- Timestamp:
- 07/20/11 10:10:36 (13 years ago)
- Location:
- ps/trunk/source
- Files:
-
- 2 edited
-
lib/sysdep/arch/x86_x64/x86_x64.cpp (modified) (1 diff)
-
ps/Util.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/lib/sysdep/arch/x86_x64/x86_x64.cpp
r9871 r9886 480 480 size_t numSamples = 16; 481 481 // if clock is low-res, do less samples so it doesn't take too long. 482 // balance measuring time (~ 10 ms) and accuracy (< 1 0/00error -482 // balance measuring time (~ 10 ms) and accuracy (< 0.1% error - 483 483 // ok for using the TSC as a time reference) 484 484 if(timer_Resolution() >= 1e-3) -
ps/trunk/source/ps/Util.cpp
r9572 r9886 101 101 // CPU 102 102 fprintf(f, "CPU : %s, %s (%dx%dx%d)", un.machine, cpu_IdentifierString(), (int)cpu_topology_NumPackages(), (int)cpu_topology_CoresPerPackage(), (int)cpu_topology_LogicalPerCore()); 103 const double cpu_freq = os_cpu_ClockFrequency(); 104 if(cpu_freq != 0.0f) 105 { 106 if(cpu_freq < 1e9) 107 fprintf(f, ", %.2f MHz\n", cpu_freq*1e-6); 103 double cpuClock = os_cpu_ClockFrequency(); // query OS (may fail) 104 if(cpuClock <= 0.0) 105 cpuClock = x86_x64_ClockFrequency(); // measure (takes a few ms) 106 if(cpuClock > 0.0) 107 { 108 if(cpuClock < 1e9) 109 fprintf(f, ", %.2f MHz\n", cpuClock*1e-6); 108 110 else 109 fprintf(f, ", %.2f GHz\n", cpu _freq*1e-9);111 fprintf(f, ", %.2f GHz\n", cpuClock*1e-9); 110 112 } 111 113 else
Note:
See TracChangeset
for help on using the changeset viewer.
