The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
385 B
21 lines
385 B
9 years ago
|
/* Simple prog that sleeps for a random time. */
|
||
|
|
||
|
#include<stdlib.h>
|
||
|
#include<time.h>
|
||
9 years ago
|
#if defined(_WIN32)
|
||
9 years ago
|
#include<windows.h>
|
||
|
#endif
|
||
|
|
||
|
int main(int argc, char **argv) {
|
||
|
srand(time(NULL));
|
||
9 years ago
|
#if !defined(_WIN32)
|
||
9 years ago
|
struct timespec t;
|
||
|
t.tv_sec = 0;
|
||
|
t.tv_nsec = 199999999.0*rand()/RAND_MAX;
|
||
|
nanosleep(&t, NULL);
|
||
|
#else
|
||
9 years ago
|
Sleep(50.0*rand()/RAND_MAX);
|
||
9 years ago
|
#endif
|
||
|
return 0;
|
||
|
}
|