#include "stdafx.h"
/*#include "Profiler.h"
#include "IRender.h"

/*void Profiler::Start()
{
	m_marks.clear();
	m_totalTime = 0;
	m_timer.restart();
}

void Profiler::Mark( const std::string & name )
{
	m_marks.push_back(SMark());
	m_marks.back().m_name = name;
	float prevMark = (m_marks.size() == 1) ? 0 : m_marks[ m_marks.size()-2 ].m_time;
	float nowMark = m_timer.elapsed();
	float dt =  nowMark - prevMark;
	m_marks.back().m_time =  dt;
}

void Profiler::End()
{
	m_totalTime = m_timer.elapsed();
}

void Profiler::Render( IRender & render, float x1, float y1 )
{
	float y = y1;
	render.SetFontSize(15);
	for ( int i = 0; i < (int)m_marks.size(); ++i )
	{
		y += 15;
		render.DrawText( x1, y, Color(255,255,255), "% 16s: %3.3fs (%2.2f%%)", m_marks[i].m_name.c_str(), m_marks[i].m_time, 100*m_marks[i].m_time/m_totalTime);
	}
	render.DrawText( x1, y + 15, Color(255,255,255),"Total: %fs", m_totalTime );
}

Profiler & GetProfiler()
{
	static Profiler p;
	return p;
}*/