
21. High-level API Reference
YAPI
YAPI.Sleep()
ySleep()
Pauses the execution flow for a specified duration.
js
function ySleep(
ms_duration
,
errmsg
)
cpp
YRETCODE ySleep( unsigned
ms_duration
, string&
errmsg
)
m
+(YRETCODE) Sleep :(unsigned)
ms_duration
:(NSError **)
errmsg
pas
function ySleep(
ms_duration
: integer, var
errmsg
: string): integer
vb
function ySleep( ByVal
ms_duration
As Integer,
ByRef
errmsg
As String) As Integer
cs
int Sleep( int
ms_duration
, ref string
errmsg
)
java
int Sleep( long
ms_duration
)
uwp
async Task<int> Sleep( ulong
ms_duration
)
py
def Sleep(
ms_duration
,
errmsg
=None)
php
function ySleep(
$ms_duration
,
&$errmsg
)
es
function Sleep(
ms_duration
,
errmsg
)
This function implements a passive waiting loop, meaning that it does not consume CPU cycles
significantly. The processor is left available for other threads and processes. During the pause, the
library nevertheless reads from time to time information from the Yoctopuce modules by calling
yHandleEvents()
, in order to stay up-to-date.
This function may signal an error in case there is a communication problem while contacting a module.
Parameters :
ms_duration
an integer corresponding to the duration of the pause, in milliseconds.
errmsg
a string passed by reference to receive any error message.
Returns :
YAPI_SUCCESS
when the call succeeds.
On failure, throws an exception or returns a negative error code.
160
www.yoctopuce.com
Summary of Contents for Yocto-RangeFinder
Page 1: ...Yocto RangeFinder User s guide...
Page 2: ......
Page 18: ...12 www yoctopuce com...
Page 26: ...20 www yoctopuce com...
Page 42: ...36 www yoctopuce com...
Page 70: ...gcc lyocto lm lpthread lusb 1 0 lstdc 10 Using Yocto RangeFinder with C 64 www yoctopuce com...
Page 90: ...84 www yoctopuce com...
Page 120: ...114 www yoctopuce com...
Page 130: ...124 www yoctopuce com...
Page 484: ...478 www yoctopuce com...
Page 488: ...482 www yoctopuce com...
Page 490: ...23 Characteristics 484 www yoctopuce com...
Page 491: ......
Page 492: ......