/*
	Twilight Prophecy 3D/Multimedia SDK
	A multi-platform development system for virtual reality and multimedia.

	Copyright (C) 1997-2001 by Twilight 3D Finland Oy Ltd.

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

	Please read the file LICENSE.TXT for additional details.


	source: 
		Timer example

	revision history:
		Jan/01/1999 - Jukka Liimatta - initial revision
*/
#include <prcore/prcore.hpp>
#include <iostream>

using namespace prcore;
using namespace std;



namespace
{
	float delay()
	{
		float j = 0;
		int count = 210000;

		do
		{
			j += 0.12f;
			j *= j;
		} while ( --count );

		// return j to defeat optimizer
		return j;
	}
	
} // namespace



int main()
{
	Timer timer;
	float time0 = timer.GetTime();

	delay();
	
	float time1 = timer.GetTime();
	cout << "delta: " << (time1-time0)*1000 << " ms" << endl;

	return 0;
}
