Simple timeout program in c, Here is implementation with a delay function