mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-11-22 13:57:10 +02:00
tornado/fw/sim/alg.c: take duration of simulation from command line
This commit is contained in:
parent
07e0df0d6a
commit
95cfa9202c
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user