xref: /reactos/base/shell/cmd/delay.c (revision 9ea495ba)
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 
14 #ifdef INCLUDE_CMD_DELAY
15 
16 
17 INT CommandDelay (LPTSTR param)
18 {
19 	DWORD val;
20 	DWORD mul=1000;
21 
22 	if (_tcsncmp (param, _T("/?"), 2) == 0)
23 	{
24 		ConOutResPaging(TRUE,STRING_DELAY_HELP);
25 		return 0;
26 	}
27 
28 	nErrorLevel = 0;
29 
30 	if (*param==0)
31 	{
32 		error_req_param_missing ();
33 		return 1;
34 	}
35 
36 	if (_tcsnicmp(param,_T("/m"),2) == 0)
37 	{
38 		mul = 1;
39 		param += 2;
40 	}
41 
42 	val = _ttoi(param);
43 	Sleep(val * mul);
44 
45 	return 0;
46 }
47 
48 #endif /* INCLUDE_CMD_DELAY */
49