#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
time_t t = time(NULL);
printf("%s", ctime(&t));
srand(time(NULL));
sleep((rand() % 10) + 1); // 1 to 10 seconds
t = time(NULL);
printf("%s", ctime(&t));
return 0;
}
/*
run:
Mon May 30 05:47:47 2022
Mon May 30 05:47:52 2022
*/