Metatarget for copying of testfile fixed.
[AROS.git] / workbench / c / Delay.c
blob17837f1ce5f16322fe318e804966f4413a82fa31
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Delay CLI command.
6 Lang: english
7 */
9 /******************************************************************************
12 NAME
14 Delay (n) [TICK | TICKS]
16 SYNOPSIS
18 TIME/N,TICK=TICKS/S
20 LOCATION
24 FUNCTION
26 Wait a certain amount of ticks clock (1/50 of a second).
28 INPUTS
30 TICK=TICKS -- time unit in ticks to wait for.
31 RESULT
33 NOTES
34 An arbitrary limit is set to 15000 ticks to wait for.
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 ******************************************************************************/
46 #include <dos/dos.h>
47 #include <proto/dos.h>
48 #include <proto/exec.h>
50 int __nocommandline;
52 int main(void)
54 IPTR args[1] = { 0 };
55 struct RDArgs *rda = ReadArgs("TIME/N,TICK=TICKS/S", args, NULL);
57 if (rda)
59 LONG ticks = *((LONG *)args[0]);
61 if (ticks >= 0 && ticks <= TICKS_PER_SECOND * 300)
63 Delay(ticks);
64 FreeArgs(rda);
65 return RETURN_OK;
67 FreeArgs(rda);
69 return RETURN_FAIL;