MCPcopy Create free account
hub / github.com/davisking/dlib / sleep

Function sleep

dlib/misc_api/misc_api_kernel_2.cpp:20–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18// ----------------------------------------------------------------------------------------
19
20 void sleep (
21 unsigned long milliseconds
22 )
23 {
24 // in HP-UX you can only usleep for less than a second
25#ifdef HPUX
26 if (milliseconds >= 1000)
27 {
28 ::sleep(milliseconds/1000);
29 unsigned long remaining = milliseconds%1000;
30 if (remaining > 0)
31 ::usleep(remaining*1000);
32 }
33 else
34 {
35 ::usleep(milliseconds*1000);
36 }
37#else
38 ::usleep(milliseconds*1000);
39#endif
40 }
41
42// ----------------------------------------------------------------------------------------
43

Callers 15

dotest1Function · 0.50
test2_jobFunction · 0.50
dotest2Function · 0.50
test_asyncFunction · 0.50
threadMethod · 0.50
threadMethod · 0.50
threadMethod · 0.50
thread1Method · 0.50
thread2Method · 0.50
thread3Method · 0.50

Calls

no outgoing calls

Tested by 15

dotest1Function · 0.40
test2_jobFunction · 0.40
dotest2Function · 0.40
test_asyncFunction · 0.40
threadMethod · 0.40
threadMethod · 0.40
threadMethod · 0.40
thread1Method · 0.40
thread2Method · 0.40
thread3Method · 0.40