CMake/Tests/CTestTestScheduler/sleep.c
Brad King 02ec5c4ad2 Tests: Add missing include in sleep sources
Sources that use `atoi` need to include `<stdlib.h>`.
2022-04-26 12:01:06 -04:00

23 lines
350 B
C

#include <stdlib.h>
#if defined(_WIN32)
# include <windows.h>
#else
# include <unistd.h>
#endif
/* sleeps for 4n seconds, where n is the argument to the program */
int main(int argc, char** argv)
{
int time;
if (argc > 1) {
time = 4 * atoi(argv[1]);
}
#if defined(_WIN32)
Sleep(time * 1000);
#else
sleep(time);
#endif
return 0;
}