Merge branch 'master' of github.com:supertuxkart/stk-code
This commit is contained in:
commit
2641f0b067
@ -81,3 +81,16 @@ void StkTime::getDate(int *day, int *month, int *year)
|
||||
if(month) *month = now->tm_mon + 1;
|
||||
if(year) *year = now->tm_year + 1900;
|
||||
} // getDate
|
||||
|
||||
StkTime::ScopeProfiler::ScopeProfiler(const char* name)
|
||||
{
|
||||
Log::info("ScopeProfiler", "%s {\n", name);
|
||||
m_time = (float)getRealTime();
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
StkTime::ScopeProfiler::~ScopeProfiler()
|
||||
{
|
||||
float f2 = (float)getRealTime();
|
||||
Log::info("ScopeProfiler", "} // took %f s (%s)\n", (f2 - m_time), m_name.c_str());
|
||||
}
|
@ -136,18 +136,10 @@ public:
|
||||
class ScopeProfiler
|
||||
{
|
||||
float m_time;
|
||||
std::string m_name;
|
||||
public:
|
||||
ScopeProfiler(const char* name)
|
||||
{
|
||||
printf("%s {\n", name);
|
||||
m_time = (float)getRealTime();
|
||||
}
|
||||
|
||||
~ScopeProfiler()
|
||||
{
|
||||
float f2 = (float)getRealTime();
|
||||
printf("} // took %f s\n", (f2 - m_time));
|
||||
}
|
||||
ScopeProfiler(const char* name);
|
||||
~ScopeProfiler();
|
||||
}; // class ScopeProfiler
|
||||
|
||||
}; // namespace time
|
||||
|
Loading…
Reference in New Issue
Block a user