sleep vs threadsleep: what are differences?

Discussion and questions about programming with Ultibo.
pik33
Posts: 878
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

sleep vs threadsleep: what are differences?

Postby pik33 » Wed Jul 10, 2019 1:26 pm

We have 2 functions to sleep: sleep and threadsleep - what are differences between them?
User avatar
Ultibo
Site Admin
Posts: 2257
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: sleep vs threadsleep: what are differences?

Postby Ultibo » Wed Jul 10, 2019 11:43 pm

pik33 wrote:We have 2 functions to sleep: sleep and threadsleep - what are differences between them?

There is actually no difference at all, ThreadSleep is the Ultibo function from the Threads unit and Sleep is the FPC RTL function from the SysUtils unit.

In the default configuration Sleep simply calls ThreadSleep, although like almost everything in Ultibo that is designed to be replaceable if you want different behavior. The reason for having both is so that FPC code that uses common RTL functions will work in Ultibo without changes in many cases, for example the TThread class works as expected and simply calls the Ultibo API internally.
Ultibo.org | Make something amazing
https://ultibo.org

Return to “General”

Who is online

Users browsing this forum: No registered users and 0 guests