window.onload = function (){

document.body.style.padding = 0
document.body.style.margin = 0
document.body.style.overflow = "hidden";

canvas = document.getElementById("canvas");
c = canvas.getContext("2d");
wWidth =	canvas.width = window.innerWidth
wHeight = canvas.height = window.innerHeight
c.strokeStyle = "#eee";
for (x=0.5; x<wWidth; x += 5) 
{
	c.moveTo(x,0); 
	c.lineTo(x,wHeight);
}
for (y=0.5; y<wHeight; y += 5) 
{
	c.moveTo(0, y); 
	c.lineTo(wWidth,y);
}
fps = 0
last_fps = 0
function getfps()
{
	last_fps = fps;
	fps = 0;
	setTimeout(getfps, 1000);
}
function update()
{
	fps++;
	c.fillStyle = "#fff";
	//console.log("starting update")
	c.fillRect(0,0,wWidth,wHeight);



	c.stroke()
	//console.log("update complete")
}
function displayMousePosition(e)
{
	update();
	c.fillStyle = "#000";
	c.font = "bold 12px sans-serif";
	c.fillText("( " + e.pageX + ", " + e.pageY + " ) @ " + last_fps + " fps",600,100);
}
getfps()
canvas.onmousemove = displayMousePosition;
//update()
};


