blob: ac35733984983fcbd20c0a45945538afb3c3d302 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include <stdio.h>
int main(int argc, char **argv) {
double t, dt;
long n;
if (argc != 4) {
fprintf(stderr, "ERROR: wrong argument count\nUse %s total_time time_per_trace \"trace command(s) \"\n", argv[0]);
return -1;
}
if ((sscanf(argv[1], "%lf", &t) != 1) ||
(sscanf(argv[2], "%lf", &dt) != 1)) {
fprintf(stderr, "failed to read arg 1/2\n");
return -1;
}
printf("%f, %f\n", t, dt);
// print the full command once
// now print enough newline (= command repetitions)
// TODO: be faster than lame-duck-speed
n = (long) (t / dt); // on step already passed because of above printf statement
while (n>1) {
printf("\n");
n--;
}
}
|