home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / cenvi29.zip / OS2WAIT.BAT < prev    next >
DOS Batch File  |  1994-08-13  |  1KB  |  42 lines

  1. @echo OFF
  2. REM *****************************************************************
  3. REM *** OS2Wait.bat - Wait (approximately) specified milliseconds ***
  4. REM *** ver.1         and give up processor timeslices (as much   ***
  5. REM ***               as reasonable) during that time.            ***
  6. REM *****************************************************************
  7. CEnvi %0.bat %1 %2
  8. GOTO CENVI_EXIT
  9.  
  10. Instructions()
  11. {
  12.    puts("\a")
  13.    puts(`OS2Wait - Wait specified millisecond count in DOS VDM under OS/2`)
  14.    puts(``)
  15.    puts(`SYNTAX: OS2Wait <MilliSeconds>`)
  16.    puts(``)
  17.    puts(`WHERE: MilliSeconds: Time to wait, approximately in milliseconds,`)
  18.    puts(`                     where 1000 is equal to 1 second`)
  19.    puts(``)
  20.    exit(EXIT_FAILURE);
  21. }
  22.  
  23. main(argc,argv)
  24. {
  25.    if ( argc != 2  ||  (WaitTime = atoi(argv[1])) < 1 )
  26.       Instructions();
  27.  
  28.    Dos_DosSuspend(WaitTime);
  29. }
  30.  
  31.  
  32. Dos_DosSuspend(pMilliSecondWait)
  33. {
  34.    lMicroSecond = pMilliSecondWait * 1000;
  35.    reg.ah = 0x86;
  36.    reg.cx = (lMicroSecond >> 16) & 0xFFFF;
  37.    reg.dx = lMicroSecond & 0xFFFF;
  38.    interrupt(0x15,reg);
  39. }
  40.  
  41. :CENVI_EXIT
  42.