__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.
Syntax
unsigned __int64 __rdtsc();
Return value
A 64-bit unsigned integer representing a tick count.
Requirements
Intrinsic | Architecture |
---|---|
__rdtsc |
x86, x64 |
Header file <intrin.h>
Remarks
This routine is available only as an intrinsic.
The interpretation of the TSC value in later generations of hardware differs from that in earlier versions of x64. For more information, see the hardware manuals.
Example
// 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
END Microsoft Specific
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho