1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-22 14:33:09 +02:00

tornado/fw/sim/alg.c: take duration of simulation from command line

This commit is contained in:
Werner Almesberger 2012-12-09 16:32:17 -03:00
parent 07e0df0d6a
commit 95cfa9202c

View File

@ -67,11 +67,25 @@ static void process(unsigned v)
} }
int main(void) static void usage(const char *name)
{ {
fprintf(stderr, "usage: %s [seconds]\n", name);
exit(1);
}
int main(int argc, char **argv)
{
double t;
char *end;
int i; int i;
for (i = 0; i != 10*S; i++) { if (argc != 2)
usage(*argv);
t = strtod(argv[1], &end);
if (*end)
usage(*argv);
for (i = 0; i != t*S; i++) {
unsigned v = sample((double) i/S); unsigned v = sample((double) i/S);
process(v); process(v);