The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017



The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at __rdtsc.

Microsoft Specific**

Generates the rdtsc instruction, which returns the processor time stamp. The processor time stamp records the number of clock cycles since the last reset.

unsigned __int64 __rdtsc();  

A 64-bit unsigned integer representing a tick count.

__rdtscx86, x64

Header file <intrin.h>

This routine is available only as an intrinsic.

The interpretation of the TSC value in this generation of hardware differs from that in earlier versions of x64. See hardware manuals for more information.

// rdtsc.cpp  
// processor: x86, x64  
#include <stdio.h>  
#include <intrin.h>  
#pragma intrinsic(__rdtsc)  
int main()  
    unsigned __int64 i;  
    i = __rdtsc();  
    printf_s("%I64d ticks\n", i);  

3363423610155519 ticks  

Compiler Intrinsics