MCPcopy Create free account
hub / github.com/Tencent/libco / counter

Function counter

co_routine.cpp:68–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67#if defined( __LIBCO_RDTSCP__)
68static unsigned long long counter(void)
69{
70 register uint32_t lo, hi;
71 register unsigned long long o;
72 __asm__ __volatile__ (
73 "rdtscp" : "=a"(lo), "=d"(hi)::"%rcx"
74 );
75 o = hi;
76 o <<= 32;
77 return (o | lo);
78
79}
80static unsigned long long getCpuKhz()
81{
82 FILE *fp = fopen("/proc/cpuinfo","r");

Callers 1

GetTickMSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected