1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-07-02 14:04:15 +00:00

cpuid_tool: Added --clock-os key to enable queries to cpu_clock_by_os()

rdtsc.c: Ported CPU clocking code to Win32, debugged Registry stuff

git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@30 3b4be424-7ac5-41d7-8526-f4ddcb85d872
This commit is contained in:
Veselin Georgiev 2008-11-21 19:05:18 +00:00
parent 9cf8005f3a
commit 2fb7b0522b
2 changed files with 16 additions and 14 deletions

View file

@ -81,6 +81,7 @@ typedef enum {
NEED_CODENAME,
NEED_FEATURES,
NEED_CLOCK,
NEED_CLOCK_OS,
NEED_CLOCK_RDTSC,
} output_data_switch;
@ -128,6 +129,7 @@ matchtable[] = {
{ NEED_CODENAME , "--codename" , 1},
{ NEED_FEATURES , "--flags" , 1},
{ NEED_CLOCK , "--clock" , 0},
{ NEED_CLOCK_OS , "--clock-os" , 0},
{ NEED_CLOCK_RDTSC , "--clock-rdtsc" , 1},
};
@ -378,6 +380,9 @@ static void print_info(output_data_switch query, struct cpu_raw_data_t* raw,
case NEED_CLOCK:
fprintf(fout, "%d\n", cpu_clock());
break;
case NEED_CLOCK_OS:
fprintf(fout, "%d\n", cpu_clock_by_os());
break;
case NEED_CLOCK_RDTSC:
fprintf(fout, "%d\n", cpu_clock_measure(400, 1));
break;