SLEEP not working on the iPhone

Previous topic - Next topic

Millerszone

SLEEP doesn't seem to be working on the iPhone.

Tried SLEEP 500, SLEEP 1000, SLEEP 5000

Using version GLBasic version 9.026
Hardware: iMac 27", MacBook Air, PC 3.5Ghz Quad
Developing Tools: GLBasic SDK, Gideros Studio, PureBasic
Developing for: iOS, Android, Windows, OS X, webOS, HTML5

msx

#1
You try this.

Code (glbasic) Select
FUNCTION Pause%: delay%
  LOCAL time_start% = GETTIMERALL()
  WHILE ABS(GETTIMERALL() - time_start) < delay
    FOR i=1 TO 1000; NEXT
  WEND
ENDFUNCTION


Marmor

this will work but not really help msx because sleep give power to the os . or ?

Moebius

Quotethis will work but not really help msx because sleep give power to the os . or ?

That's true, but when SLEEP isn't working your only choice is to loop.

I recall something like this being posted before:

Code (glbasic) Select
FUNCTION Pause%: delay%
  LOCAL time_start% = GETTIMERALL()
  SLEEP delay%
  WHILE GETTIMERALL() - time_start < delay
  WEND
ENDFUNCTION


That way, if SLEEP works you save processor time, otherwise it just waits anyway.  Someone made a thread on this a while ago...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary