#include <psychlops.h>
using namespace Psychlops;

void psychlops_main() {
 
 Canvas sampleA(Canvas::fullscreen);
 double elapsed=0.0, dcx, dcy;
 Clock Start, End;
 
 dcx=sampleA.getHcenter();
 dcy=sampleA.getVcenter();
 sampleA.clear(Color(0.5));
 sampleA.flip();
 
 while(!Input::get(Keyboard::esc)) {
 
	if(Input::get(Keyboard::spc, Keyboard::released)){
		End.update();
		elapsed=(End-Start).at_msec();
		sampleA.clear(Color(0.5));
		sampleA.flip();
		sampleA.clear(Color(0.5));
		sampleA.msg("Elapsed Time(msec)", dcx-100,dcy-30, Color::white);
		sampleA.var((int)elapsed,dcx ,dcy, Color::white);
		sampleA.flip();
		}
  
	if(Input::get(Keyboard::spc, Keyboard::pushed)){
		Start.update();
		Input::refresh();
		} 
	}
}