sum += h->data[i];
cum = sum;
for (i = 0; i < h->allocated; i++) {
- if (h->data[i] != 0)
- fprintf(f, "%d %lld\n", i*h->resolution, cum);
+ if (h->data[i] != 0) {
+ if (!getenv("CANPING_MS"))
+ fprintf(f, "%d %lld\n", i*h->resolution, cum);
+ else
+ fprintf(f, "%g %lld\n", 1e-3*(i*h->resolution), cum);
+ }
cum -= h->data[i];
}
}
int i;
snprintf(buf, sizeof(buf), "%s-%d.dat", option_save_all_times, ping_id);
f = fopen(buf, "w");
- for (i=0; i<option_count; i++)
- fprintf(f, "%u\n", td->times[i]);
+ for (i=0; i<option_count; i++) {
+ if (!getenv("CANPING_MS"))
+ fprintf(f, "%u\n", td->times[i]);
+ else
+ fprintf(f, "%g\n", 1e-3*td->times[i]);
+ }
fclose(f);
}