Online Documentation - Statistics - FAQ - Plugin Parts (All, Dependencies) - Class hierarchy
New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1
The list of the topics, classes, interfaces, controls, modules, global methods by category, global methods by name, screenshots, licenses and examples.
Platforms to show: All Mac Windows Linux Cross-Platform
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
global method | System | MBS Util Plugin | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The application should take nearly 0% CPU Power till time has gone.
If you need more options like blocking other RB threads, check the DelayMBS method with mode parameter.
Another example from Kirk Clendinning:
Property: lastupdate as Integer
Sub YieldProcessorTime(periodticks as Integer, widthmilliseconds as Integer)
// use the Monkeybread Software delay to yeild time for a screen update
// every period*ticks for a pulse width of width milliseconds
if ticks>lastupdate+periodTicks then
delayMBS widthmilliseconds/1000
lastupdate=ticks
end if
exception err
ExceptionReport(err, "Utils:Methods:YieldProcessorTime")
end sub
YieldProcessorTime(15, 20) gives me a delay of 20ms every 250ms. But,
since the delayMBS yields time more efficiently than using a RB thread, this turns out to be a much more effective way to update progress bars etc.
I don't need the delay per se, but since RB still hasn't written a good yield function (that I know of) your delayMSB works instead.
Please use optional mode flags with DelayDontWaitNextEvent when using on thread.
Using DelayMBS on Web Applications can cause problems as the server is paused than for all clients, a really bad thing.
See also:
DelayMBS(time as Double, mode as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
global method | System | MBS Util Plugin | 6.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Like DelayMBS with one parameter but additional mode parameter:
combine the following constants:
const DelayDontMPYield = 1 | // Don't give additional time for other OS threads |
const DelayDontRBYield = 2 | // Don't give Xojo time for other Xojo threads |
const DelayDontThreadYield = 4 | // Don't give addition time for other OS threads |
const DelayDontQuickTimeYield = 8 | // Don't give time for QuickTime Movieplayer |
const DelayDontWait = 16 | // Don't give CPU time for other OS threads |
const DelayDontWaitNextEvent = 32 | // Don't give CPU time to handle events on Mac OS X to avoid beachball cursor |
const DelayDontSleep = 64 | // Don't give CPU time for other OS threads (Windows) |
See also:
The items on this page are in the following plugins: MBS Util Plugin.