Click here to Skip to main content
15,892,253 members
Articles / Desktop Programming / MFC

Easy Profiler - Compile-time Profiler for C++

Rate me:
Please Sign up or sign in to vote.
4.94/5 (34 votes)
14 Nov 2009Apache23 min read 123.2K   5.1K   154  
Easily instrument your code, visualize, interpret results, track optimization, compare and decide.
// Profiler.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
#include "Profiler.h"



#include "TestSession.h"




CTest* pCurrentTest=NULL;


PROFILER_API void startRegion(char* regionName,char collectionType)
{
	pCurrentTest=new CTest(regionName);
	pCurrentTest->initTest();
	//
	if (collectionType=='p')
	{
		pCurrentTest->setCompressionMode();
	}
}
//
PROFILER_API void startActivity(char* activityName)
{
	pCurrentTest->beginActivity(activityName);
}
PROFILER_API void insertCheckPoint(char* checkPointName,char* activityName)
{
	pCurrentTest->insertCheckPoint(activityName,checkPointName);
}
PROFILER_API void stopActivity(char* activityName)
{
	pCurrentTest->endActivity(activityName);
}
PROFILER_API void startTask(char* taskName)
{
	pCurrentTest->beginTask(taskName);
}
PROFILER_API void stopTask(char* taskName)
{
	pCurrentTest->endTask(taskName);
}
PROFILER_API void startWorker(char* workerName)
{
	pCurrentTest->runWorker(workerName);
}
PROFILER_API void stopWorker(char* workerName)
{
	pCurrentTest->pauseWorker(workerName);
}
//
PROFILER_API void flushRegion(char* regionName,char* outputDirectory,char outputType)
{
	pCurrentTest->flush(regionName,outputDirectory,outputType);
}

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.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Technical Lead
Tunisia Tunisia
Services:
http://www.pushframework.com/?page_id=890

Comments and Discussions