Tip: Reducing CPU usage in tight loops

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> Is 'delay(x)' equal to 'sleep_(x)' ?

Yes. Both wait for x milliseconds before continuing. Delay is a PureBasic
command that can be used in Amiga/Linux/Windows, but Sleep_ is Windows only.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
> Is 'delay(x)' equal to 'sleep_(x)' ?

Yes. Both wait for x milliseconds before continuing. Delay is a PureBasic
command that can be used in Amiga/Linux/Windows, but Sleep_ is Windows only.
Oops, apologies that I said "Delay_" was an Amiga API command (which it is :), I did not realise PB had a "Delay" command too.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
Post Reply