globalstep or minetest.after?

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

globalstep or minetest.after?

by burli » Mon May 16, 2016 06:43

If you want to call a function every few seconds and you don't need high accuracy, wouldn't it be better to use minetest.after instead of globalstep? What is more efficient?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: globalstep or minetest.after?

by Krock » Mon May 16, 2016 08:18

minetest.after() is not a core function and is based on register_globalstep too.
Lua is fast, thus, you won't notice any speed increase when you use globalstep instead of minetest.after

https://github.com/minetest/minetest/bl ... sc.lua#L40
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron