1 #include "oslib/osmodule.h"
6 #include "oslib/taskwindow.h"
10 int riscos_sleep(double delay)
12 os_t starttime, endtime, time; /* monotonic times (centiseconds) */
16 /* calculate end time */
17 starttime = os_read_monotonic_time();
18 if (starttime + 100.0*delay >INT_MAX)
21 endtime = (os_t)(starttime + 100.0*delay);
23 /* allocate (in RMA) and set pollword for xupcall_sleep */
24 pollword = osmodule_alloc(4);
29 while ( time<endtime && time>=starttime ) {
30 xupcall_sleep (pollword, &claimed);
31 if (PyErr_CheckSignals()) {
35 time = os_read_monotonic_time();
38 /* deallocate pollword */
39 osmodule_free(pollword);