Difference between revisions of "Talk:love.run"

 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
: You can probably get a more detailed answer on the forums.
 
: You can probably get a more detailed answer on the forums.
 
: [[User:Hryx|~hryx]] 07:40, 16 January 2014 (CET)
 
: [[User:Hryx|~hryx]] 07:40, 16 January 2014 (CET)
 +
 +
Thanks, Hryx.
 +
https://love2d.org/forums/viewtopic.php?f=4&t=76998
 +
--[[User:Antoniomoder|Antoniomoder]] ([[User talk:Antoniomoder|talk]]) 04:08, 20 September 2015 (CEST)
 +
 +
 +
Again:
 +
<source lang="lua">
 +
if love.timer then love.timer.sleep(0.001) end
 +
</source>
 +
Can we store the value something like this:?
 +
<source lang="lua">
 +
if love.timer then love.timer.sleep(love.timer.sleep_value or 0.001) end
 +
</source>
 +
So the sleep_value can be changed from the running code? [[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 23:32, 9 May 2020 (CEST)

Latest revision as of 21:32, 9 May 2020

For what this delay?

if love.timer then love.timer.sleep(0.001) end

Without this FPS is up.

Without sleeping between updates, the system will keep computing them as fast as possible, needlessly using up CPU time.
Even with the above 1ms sleep, a game can produce several hundred FPS.
You can probably get a more detailed answer on the forums.
~hryx 07:40, 16 January 2014 (CET)

Thanks, Hryx. https://love2d.org/forums/viewtopic.php?f=4&t=76998 --Antoniomoder (talk) 04:08, 20 September 2015 (CEST)


Again:

if love.timer then love.timer.sleep(0.001) end

Can we store the value something like this:?

if love.timer then love.timer.sleep(love.timer.sleep_value or 0.001) end

So the sleep_value can be changed from the running code? Darkfrei (talk) 23:32, 9 May 2020 (CEST)