pikelang / Pike

Pike is a dynamic programming language with a syntax similar to Java and C. It is simple to learn, does not require long compilation passes and has powerful built-in data types allowing simple and really fast data manipulation.
http://pike.lysator.liu.se/
Other
194 stars 34 forks source link

How can I make a function execute every X seconds? #12

Closed TheOnlyArtz closed 5 years ago

TheOnlyArtz commented 5 years ago

How can I make a function execute every X seconds? Something equivalent to setInterval and setTimeout in Javascript!

agehall commented 5 years ago

Hi,

http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/call_out.html is your friend here. Do note that it will run the callback from the backend, so you need to return -1 from your main() to start the backend or it will not work.

/Marcus

On 1 Dec 2018, at 19:59, Amit Katz notifications@github.com wrote:

How can I make a function execute every X seconds? Something equivalent to setInterval and setTimeout in Javascript!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pikelang/Pike/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHYK6v9cCuT2me_JQ4SMsnRwDxLT99Mks5u0tGAgaJpZM4Y9CQJ.

TheOnlyArtz commented 5 years ago

I see, thanks :) , what should I do in order to make it repeat?