MCPcopy Create free account
hub / github.com/albertobsd/keyhunt / sleep_ms

Function sleep_ms

bsgsd.cpp:1947–1960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1945
1946
1947void sleep_ms(int milliseconds) { // cross-platform sleep function
1948#if defined(_WIN64) && !defined(__CYGWIN__)
1949 Sleep(milliseconds);
1950#elif _POSIX_C_SOURCE >= 199309L
1951 struct timespec ts;
1952 ts.tv_sec = milliseconds / 1000;
1953 ts.tv_nsec = (milliseconds % 1000) * 1000000;
1954 nanosleep(&ts, NULL);
1955#else
1956 if (milliseconds >= 1000)
1957 sleep(milliseconds / 1000);
1958 usleep((milliseconds % 1000) * 1000);
1959#endif
1960}
1961
1962
1963void *thread_bPload(void *vargp) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected