- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
We'll forward your feedback to our engineering contacts and let you know how they respond.
Regards,
Lexi S.
IntelSoftware NetworkSupport
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Our engineering contacts responded:
You can use RDTSC, which is the processor counter. It is updated every clock cycle. It is not a serializing instruction, so if you want a time stamp after all the work is done, also use a serializing instruction like CPUID.
For the case below you do not need it, but you will if you are timing a piece of code.
Also, this will not work well on laptops running on battery.
Here is some example code for precise counters. Just include this .h file and use macros to start, stop and get time.#define _USE_COUNTERS_
#ifndef _PERF_TIMERS_
#define _PERF_TIMERS_
#ifdef _USE_COUNTERS_
#define INIT_COUNTER
unsigned __int64 start, end;
void *pStart = &start;
void *pEnd = &end;
char pClockTickBuf[100];
#define START_COUNTER
{_asm mov eax, 0
_asm cpuid
_asm rdtsc
_asm mov ebx, pStart
_asm mov dword ptr[ebx], eax
_asm mov dword ptr[ebx+4], edx
_asm mov eax, 0
_asm cpuid}
#define STOP_COUNTER
{_asm mov eax, 0
_asm cpuid
_asm rdtsc
_asm mov ebx, pEnd
_asm mov dword ptr[ebx], eax
_asm mov dword ptr[ebx+4], edx
_asm mov eax, 0
_asm cpuid}
#define GET_COUNT(buf)
{_ui64toa(end-start,buf,10);}
#define GET_COUNT_MS(buf)
{_ui64toa((end-start)/3000000,buf,10);}
#else
#define INIT_COUNTER
#define START_COUNTER
#define STOP_COUNTER
#define GET_COUNT(buf)
#endif // _USE_COUNTERS_
#endif //_PERF_TIMERS_
We also found some further explanation on this third-party site:
http://www.codeguru.com/Cpp/misc/misc/timers/article.php/c3895/
Please note that these links will take you to external web sites. Intel is not responsible for content or availability of these sites.
Regards,
Lexi S.
IntelSoftware NetworkSupport
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite