#include #include #include void* thread_one(void*){ while(1){ time_t now = time(0); char *time_string = ctime(&now); sleep(2); puts(time_string); } } void* thread_two(void*){ while(1){ // This actually didn't cause a problem for us! time_t zero = 0; char *time_string_two = ctime(&zero); sleep(1); } } int main(){ pthread_t t1, t2; pthread_create(&t1, 0, thread_one, 0); pthread_create(&t2, 0, thread_two, 0); printf("t1 = %d, t2 = %d\n", t1, t2); pthread_join(t1, 0); return 0; }