blob: 3fb0a1b07466ff54f1ce8ca8dd968570bd03ae6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include <stdio.h>
#include <sys/types.h>
#include "osfreq.c"
long long cpucycles_x86cpuinfo(void)
{
long long result;
asm volatile(".byte 15;.byte 49" : "=A" (result));
return result;
}
long long cpucycles_x86cpuinfo_persecond(void)
{
return osfreq();
}
|