|
// TimerDemo.cpp : Sample demostrating timer code
//
#include "stdafx.h"
#include "MultiTimer.h"
void testfun()
{
TIME_LINE(printf("Hello World!\n");)
}
void main()
{
{
TIME_SCOPE("total test")
for (int i = 0; i < 10; i++)
TIME_FUN(testfun())
}
TIMER_START("Manual Timer")
Sleep(1000);
TIMER_STOP("Manual Timer")
TIMER_DUMP_FILE("times.txt", SORT_CALLORDER, FILE_APPEND)
TIMER_DUMP(OUT_MSGBOX, SORT_CALLORDER)
CHiFreqTimer& timer = GET_TIMER("testfun()");
printf("\nTotal: %s\n", T2S(timer.getTotalTime()));
printf("Minimum: %s\n", T2S(timer.getMinimumTime()));
printf("Maximum: %s\n", T2S(timer.getMaximumTime()));
printf("Average: %s\n\n", T2S(timer.getAverageTime()));
TIMER_DUMP_SAMPLES(timer, OUT_CONSOLE)
printf("\nPress any key...");
getch();
printf("\n");
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.