If you don't want to change much:
Just use a simple(not optimal, but very simple) fixed timestep then: (If you want to do it properly, read this: http://gafferongames.com/game-physics/fix-your-timestep/ )
add:
double currentTime, lastTime;
const double timePerFrame = 16.66667; //60 updates per second, roughly
currentTime = lastTime = systemfunctiontogetcurrenttimeaccuratly();
before your main loop.
and
currentTime = systemfunctiontogetcurrenttimeaccuratly();
if (currentTime - lastTime < timePerFrame) continue;
lastTime+=timePerFrame;
//update and render normally here
at the top of your mainloop (inside the loop, just after the while)
set timePerFrame to whatever makes your game run at the speed you want.