glfw slow

I use glfw and Dev C++ 5.4.1. I created code in my game to limit the frames rendered to 60 for cards that don't have vsync. Compiled the program, and CPU usage is insane. here's my entire game loop:
1
2
3
4
5
6
7
8
9
10
                currentTime = glfwGetTime();
		elapseTime = currentTime-deltaTime;
		deltaTime = currentTime;
		 
		updateTimer += elapseTime;
		if(updateTimer >= updateInterval){
			process();
			render();
			updateTimer=0;
		}

by commenting lines, I found out that it was deltaTime = currentTime; that was causing the CPU usage. I tried changing variable names, recompiling, changing variables to floats, etc. Any other ideas?
CPU usage is insane
This is normal. Without vsync, the only way to limit the framerate in a predictable way is to waste CPU time in empty loops.

I created code in my game to limit the frames rendered to 60 for cards that don't have vsync.
I wouldn't bother with this. vsync has been around for ages. Worst case scenario, you'll draw more frames than needed (probably not, though, since hardware that old would probably be fairly slow, anyway). At least the computer will be doing marginally useful work.
Topic archived. No new replies allowed.