echoping/SRC/plugins/random/random.c

33 lines
412 B
C
Raw Normal View History

/*
2004-04-06 09:49:26 +00:00
* Pseudo-random plugin. Just an example.
*
* $Id$
*/
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
2004-04-06 09:49:26 +00:00
char *
init (const int argc, const char *argv[])
{
struct timeval tv;
(void) gettimeofday (&tv, (struct timezone *) NULL);
srand (tv.tv_usec);
2004-04-06 09:49:26 +00:00
return NULL;
}
void start ()
{
}
int
execute ()
{
usleep (rand () % 1000000);
return 1;
}
void terminate() {}