fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5.  
  6.  
  7. void main(void){
  8. /*initialize*/
  9. clock_t start_t = 0, end_t = 0;
  10.  
  11. while(1){
  12. if(end_t-start_t){
  13. start_t = end_t;
  14. /*inerrupt function*/
  15. secint(); //interrupted every second
  16. }
  17. else{
  18. end_t = clock() / CLOCKS_PER_SEC;
  19. /*main program*/
  20.  
  21. }
  22. }
  23. }
  24.  
  25. void secint(void){
  26. printf("hi\n");
  27. }
  28.  
Time limit exceeded #stdin #stdout 5s 9424KB
stdin
Standard input is empty
stdout
Standard output is empty