# rdtscp_timer **Repository Path**: gxl777/rdtscp_timer ## Basic Information - **Project Name**: rdtscp_timer - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-08 - **Last Updated**: 2025-02-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # rdtscp_timer Timer using the RDTSCP instruction for nanosecond-granularity This library provides a means for obtaining nanosecond-granularity timing information for experimental analysis or profiling. It uses the RDTSCP timestamp counter instruction for x86 if provided with a CPU frequency, or falls back on the Linux clock_gettime function. Sample program: #include "timing.hh" #include #include int main() { Timer t(2.4); t.tick(); sleep(5); t.tock(); std::cout << "Time taken: " << t.get_time() << std::endl; return 0; }