#include #include #include main() { FILE *f; time_t t0; t0 = time(0); srand48(t0 + getpid()); f = fopen("logfile.txt", "a"); fprintf(f, "%10d Started: %s", getpid(), ctime(&t0)); fclose(f); sleep(lrand48()%5+1); t0 = time(0); f = fopen("logfile.txt", "a"); fprintf(f, "%10d Done: %s", getpid(), ctime(&t0)); fclose(f); exit(0); }