X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=simprog.c;h=8311d508058dd478a96b0513026f6c5155e54432;hp=a71384772089c02f1217dca468fb30578a50a46a;hb=d385ba13a2ded8ce22b83c82d8a50c89a5d1d63e;hpb=52feef3369ad80d5b7207620f37ae341ccd11b95 diff --git a/simprog.c b/simprog.c index a713847..8311d50 100644 --- a/simprog.c +++ b/simprog.c @@ -1,7 +1,7 @@ #include #include #include - +#include void print_help(char name[]) { @@ -37,6 +37,7 @@ int main (int argc, char** argv) int i, rand_value, sum; int retvals[100]; int percentages[100]; + struct timeval td; if (argc==2 && strcmp("--help",argv[1])==0 ) { @@ -52,7 +53,8 @@ int main (int argc, char** argv) /* Get random number in interval [0,100) */ - srand(time(0)); + gettimeofday(&td,0); + srand(td.tv_usec); rand_value = rand() % 100; /* See if we want to fire an "error" */