Skip to content

Instantly share code, notes, and snippets.

@jimfinnis
Created March 22, 2016 11:07
Show Gist options
  • Save jimfinnis/ca4e0893c07e426b97cd to your computer and use it in GitHub Desktop.
Save jimfinnis/ca4e0893c07e426b97cd to your computer and use it in GitHub Desktop.
double prevtime = now();
for(;;){
render();
double t = now() - prevtime;
prevtime = now();
while(t>MINUPDATETIME){
update(MINUPDATETIME);
t-=MINUPDATETIME;
}
update(t);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment