C program to implement software timer

C program to implement software timer


#include <stdio.h>
#include <time.h>
int main()
{
    time_t start = time(NULL);
   for (;;)
    {
        if (time(NULL) > start + 10) {
         printf("10s timeout!\n");               
         break;
    }
}
    return 0;

}