MCPcopy Create free account
hub / github.com/F-Stack/f-stack / debugDelay

Function debugDelay

app/redis-6.2.6/src/debug.c:1983–1988  ·  view source on GitHub ↗

Positive input is sleep time in microseconds. Negative input is fractions * of microseconds, i.e. -10 means 100 nanoseconds. */

Source from the content-addressed store, hash-verified

1981/* Positive input is sleep time in microseconds. Negative input is fractions
1982 * of microseconds, i.e. -10 means 100 nanoseconds. */
1983void debugDelay(int usec) {
1984 /* Since even the shortest sleep results in context switch and system call,
1985 * the way we achive short sleeps is by statistically sleeping less often. */
1986 if (usec < 0) usec = (rand() % -usec) == 0 ? 1: 0;
1987 if (usec) usleep(usec);
1988}

Callers 3

rdbSaveKeyValuePairFunction · 0.85
rdbLoadRioFunction · 0.85
loadAppendOnlyFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected