Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
701 B

  1. #include <windows.h>
  2. #include <stdlib.h>
  3. //
  4. // Program sleeps for desired amount of time, but at least
  5. // two seconds. Beeps 5 times to warn of start. Beeps once at end.
  6. //
  7. int
  8. __cdecl
  9. main(
  10. int argc,
  11. char *argv[]
  12. )
  13. {
  14. unsigned i, uSecs;
  15. if(argc <=1)
  16. return(1);
  17. for (i=1; i<=5; i++) {
  18. Beep(360, 200);
  19. Sleep(200);
  20. }
  21. uSecs = atoi(argv[1]);
  22. //
  23. // The test for 2 is because we already waited for 2 seconds,
  24. // above.
  25. //
  26. // The subtraction of 700 milliseconds allows for startup
  27. // time on my 486/33 EISA machine. Your milage may vary.
  28. //
  29. if (uSecs > 2) {
  30. Sleep(1000*(uSecs-2)-700);
  31. }
  32. Beep(360, 200);
  33. return(0);
  34. }