|
#ifndef _TIMELOGGER_bb056fff_a11f_46e8_9b95_df6f32fe2fcf_
#define _TIMELOGGER_bb056fff_a11f_46e8_9b95_df6f32fe2fcf_
/*
Author : Shakti Misra
Copy Right: 2011
All are welcome to use these files, distribute, modify and release. But This notice should be included.
This software is given as is, for use and modification.
*/
//#include <stdio.h>
#ifndef _IOSTREAM_INC
#define _IOSTREAM_INC
#include <iostream>
#endif //_IOSTREAM_INC
#ifndef _FSTREAM_INC
#include<fstream>
#endif //_FSTREAM_INC
#include "CTimer.h"
class TimeLogger
{
public:
static ofstream _file;
static LARGE_INTEGER _start;
static LARGE_INTEGER _end;
private:
TimeLogger()
{}
TimeLogger(const TimeLogger& rhs)
{}
TimeLogger& operator=(TimeLogger&)
{return *this;}
void getTime(std::string&);
public:
~TimeLogger()
{
if(_file.is_open())
_file.close();
}
static TimeLogger& instance()
{
static TimeLogger loggerInstance;
return loggerInstance;
}
void init(const std::string& fileName);
void functionStart(const std::string& funName);
void functionEnd(const std::string& funName);
};
#define FUNCTION_BEGIN(name) std::string bb056ffffunName(name);\
TimeLogger::instance().functionStart(bb056ffffunName);
#define FUNCTION_END TimeLogger::instance().functionEnd(bb056ffffunName);
#endif //_TIMELOGGER_bb056fff_a11f_46e8_9b95_df6f32fe2fcf_
|
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.
I like to explore different aspects of technology. Try new things, and get delighted. My interests are programming language, and Imaging. But its not hard to work on other things also. Algorithms delight me over a coffee break.
I basically code in C++, but JAVA is not so alien for me. I know few scripting languages also. Basically I feel that knowing a programing language is just a matter of getting introduced to it.
For my other articles check my blog on homepage:
http://brainlesslabs.com/
https://github.com/BrainlessLabsInc
http://www.luxrender.net/en_GB/authors_contributors - SMISRA