Skip to main content
Tweeted twitter.com/StackGameDev/status/877608887188434945
edited tags
Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61
deleted 14 characters in body
Source Link
user1430
user1430

I've read about this topic on numerous discussion sites, but I can't seem to find a clear definitive (up-to-date) answer, and hopefully this will me some more insight:

I've read the excellent game loop time article on Fix your timestep!, but it dosn't take any consideration of the CPU usage, so it will run at 100%. My question then, is it BAD to run at 100% CPU in your game loop?

  • If no, why? for example what about gaming on battery-driven devices like laptops? what about computer temperatures/fans/etc, and other windows applications?
  • If yes, why dosn't the article mention it, because surely that would impact it significantly? what is the best way to fix this on desktops/PC - is there only the unreliable sleep()? How would it affect the game loop suggested by the article?

Big thanks

I've read about this topic on numerous discussion sites, but I can't seem to find a clear definitive (up-to-date) answer, and hopefully this will me some more insight:

I've read the excellent game loop time article on Fix your timestep!, but it dosn't take any consideration of the CPU usage, so it will run at 100%. My question then, is it BAD to run at 100% CPU in your game loop?

  • If no, why? for example what about gaming on battery-driven devices like laptops? what about computer temperatures/fans/etc, and other windows applications?
  • If yes, why dosn't the article mention it, because surely that would impact it significantly? what is the best way to fix this on desktops/PC - is there only the unreliable sleep()? How would it affect the game loop suggested by the article?

Big thanks

I've read about this topic on numerous discussion sites, but I can't seem to find a clear definitive (up-to-date) answer, and hopefully this will me some more insight:

I've read the excellent game loop time article on Fix your timestep!, but it dosn't take any consideration of the CPU usage, so it will run at 100%. My question then, is it BAD to run at 100% CPU in your game loop?

  • If no, why? for example what about gaming on battery-driven devices like laptops? what about computer temperatures/fans/etc, and other windows applications?
  • If yes, why dosn't the article mention it, because surely that would impact it significantly? what is the best way to fix this on desktops/PC - is there only the unreliable sleep()? How would it affect the game loop suggested by the article?
Source Link
KaiserJohaan
  • 1.5k
  • 2
  • 23
  • 43

CPU usage, game loop and sleep()

I've read about this topic on numerous discussion sites, but I can't seem to find a clear definitive (up-to-date) answer, and hopefully this will me some more insight:

I've read the excellent game loop time article on Fix your timestep!, but it dosn't take any consideration of the CPU usage, so it will run at 100%. My question then, is it BAD to run at 100% CPU in your game loop?

  • If no, why? for example what about gaming on battery-driven devices like laptops? what about computer temperatures/fans/etc, and other windows applications?
  • If yes, why dosn't the article mention it, because surely that would impact it significantly? what is the best way to fix this on desktops/PC - is there only the unreliable sleep()? How would it affect the game loop suggested by the article?

Big thanks