mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
Improve TIMESPEC_TO_TIME
Add explicit TO_NSEC and TO_USEC versions to make it clearer and to allow for some optimizations.
This commit is contained in:
parent
bf6843743a
commit
088ee9f09e
8 changed files with 20 additions and 18 deletions
|
|
@ -465,7 +465,7 @@ static void run_graph(struct data *data)
|
|||
}
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
start = SPA_TIMESPEC_TO_TIME(&now);
|
||||
start = SPA_TIMESPEC_TO_NSEC(&now);
|
||||
|
||||
printf("running\n");
|
||||
|
||||
|
|
@ -487,7 +487,7 @@ static void run_graph(struct data *data)
|
|||
}
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
stop = SPA_TIMESPEC_TO_TIME(&now);
|
||||
stop = SPA_TIMESPEC_TO_NSEC(&now);
|
||||
|
||||
printf("stopping, elapsed %" PRIi64 "\n", stop - start);
|
||||
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ int main(int argc, char *argv[])
|
|||
fmt = spa_pod_builder_pop(&b);
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts2);
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_TIME(&ts2) - SPA_TIMESPEC_TO_TIME(&ts1));
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_NSEC(&ts2) - SPA_TIMESPEC_TO_NSEC(&ts1));
|
||||
|
||||
spa_debug_pod(0, NULL, &fmt->pod);
|
||||
fprintf(stderr, "build 2: ");
|
||||
|
|
@ -356,7 +356,7 @@ int main(int argc, char *argv[])
|
|||
&SPA_FRACTION(INT32_MAX,1));
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts2);
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_TIME(&ts2) - SPA_TIMESPEC_TO_TIME(&ts1));
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_NSEC(&ts2) - SPA_TIMESPEC_TO_NSEC(&ts1));
|
||||
|
||||
spa_debug_pod(0, NULL, &fmt->pod);
|
||||
spa_debug_format(0, NULL, &fmt->pod);
|
||||
|
|
@ -385,7 +385,7 @@ int main(int argc, char *argv[])
|
|||
"}", NULL);
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts2);
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_TIME(&ts2) - SPA_TIMESPEC_TO_TIME(&ts1));
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_NSEC(&ts2) - SPA_TIMESPEC_TO_NSEC(&ts1));
|
||||
|
||||
spa_debug_pod(0, NULL, &fmt->pod);
|
||||
spa_debug_format(0, NULL, &fmt->pod);
|
||||
|
|
@ -417,7 +417,7 @@ int main(int argc, char *argv[])
|
|||
fmt = spa_pod_builder_pop(&b);
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts2);
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_TIME(&ts2) - SPA_TIMESPEC_TO_TIME(&ts1));
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_NSEC(&ts2) - SPA_TIMESPEC_TO_NSEC(&ts1));
|
||||
|
||||
spa_debug_pod(0, NULL, &fmt->pod);
|
||||
spa_debug_format(0, NULL, &fmt->pod);
|
||||
|
|
@ -445,7 +445,7 @@ int main(int argc, char *argv[])
|
|||
0);
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts2);
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_TIME(&ts2) - SPA_TIMESPEC_TO_TIME(&ts1));
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_NSEC(&ts2) - SPA_TIMESPEC_TO_NSEC(&ts1));
|
||||
|
||||
spa_debug_pod(0, NULL, &fmt->pod);
|
||||
spa_debug_format(0, NULL, &fmt->pod);
|
||||
|
|
@ -472,7 +472,7 @@ int main(int argc, char *argv[])
|
|||
fmt = spa_pod_builder_pop(&b);
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts2);
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_TIME(&ts2) - SPA_TIMESPEC_TO_TIME(&ts1));
|
||||
fprintf(stderr, "elapsed %lld\n", SPA_TIMESPEC_TO_NSEC(&ts2) - SPA_TIMESPEC_TO_NSEC(&ts1));
|
||||
|
||||
spa_debug_pod(0, NULL, &fmt->pod);
|
||||
spa_debug_format(0, NULL, &fmt->pod);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue