580bdc5263ee63afbd891e6db4311d4aa62da663
[reactos.git] / reactos / subsys / system / cmd / delay.c
1 /*
2 * DELAY.C - internal command.
3 *
4 * clone from 4nt delay command
5 *
6 * 30 Aug 1999
7 * started - Paolo Pantaleo <paolopan@freemail.it>
8 *
9 *
10 */
11
12 #include "precomp.h"
13 #include "resource.h"
14
15 #ifdef INCLUDE_CMD_DELAY
16
17
18 INT CommandDelay (LPTSTR cmd, LPTSTR param)
19 {
20 DWORD val;
21 DWORD mul=1000;
22
23 if (_tcsncmp (param, _T("/?"), 2) == 0)
24 {
25 ConOutResPuts(STRING_DELAY_HELP);
26 return 0;
27 }
28
29 if (*param==0)
30 {
31 error_req_param_missing ();
32 return 1;
33 }
34
35 if (_tcsnicmp(param,_T("/m"),2) == 0)
36 {
37 mul = 1;
38 param += 2;
39 }
40
41 val = _ttoi(param);
42 Sleep(val * mul);
43
44 return 0;
45 }
46
47 #endif /* INCLUDE_CMD_DELAY */