Advertisement
Guest User

blinken

a guest
Jan 29th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <time.h>
  4.  
  5. void sleep(clock_t wait);
  6.  
  7.  
  8. void main()
  9. {
  10. long int i = 0;
  11. unsigned char A = 0;
  12.  
  13. for (i = 0; i < 10; i++)
  14. {
  15. A = !A;
  16. sleep((clock_t)1000); // 1 sekunde wird gewartet
  17. if (A)
  18. {
  19. printf("\r 0");
  20. }
  21. else
  22. {
  23. printf("\r .");
  24. }
  25. }
  26.  
  27. }
  28. void sleep(clock_t wait) // pausiert je nach dem was für eine gewünschte Zeit eingeben wird
  29. {
  30. clock_t ziel;
  31. ziel = wait + clock();
  32. while (ziel > clock());
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement