mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
organizing stuff.
This commit is contained in:
parent
3b0bff2f74
commit
3f5bad938a
23 changed files with 805 additions and 374 deletions
|
@ -23,33 +23,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
#include "utility.h"
|
||||
#include "irrlichtwrapper.h"
|
||||
#include "gettime.h"
|
||||
|
||||
TimeTaker::TimeTaker(const char *name, IrrlichtWrapper *irrlicht, u32 *result)
|
||||
TimeTaker::TimeTaker(const char *name, u32 *result)
|
||||
{
|
||||
m_name = name;
|
||||
m_irrlicht = irrlicht;
|
||||
m_result = result;
|
||||
m_running = true;
|
||||
if(irrlicht == NULL)
|
||||
{
|
||||
m_time1 = 0;
|
||||
return;
|
||||
}
|
||||
m_time1 = m_irrlicht->getTime();
|
||||
m_time1 = getTimeMs();
|
||||
}
|
||||
|
||||
u32 TimeTaker::stop(bool quiet)
|
||||
{
|
||||
if(m_running)
|
||||
{
|
||||
if(m_irrlicht == NULL)
|
||||
{
|
||||
/*if(quiet == false)
|
||||
std::cout<<"Couldn't measure time for "<<m_name
|
||||
<<": irrlicht==NULL"<<std::endl;*/
|
||||
return 0;
|
||||
}
|
||||
u32 time2 = m_irrlicht->getTime();
|
||||
u32 time2 = getTimeMs();
|
||||
u32 dtime = time2 - m_time1;
|
||||
if(m_result != NULL)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue