diff options
author | 2020-12-01 08:51:27 -0500 | |
---|---|---|
committer | 2020-12-01 08:51:27 -0500 | |
commit | 411279afc10f58c9ee8a7e5599bd96c5ff32cd6c (patch) | |
tree | ef1e83410f9a5d56837a885297ae75f6209c82a9 /src/firejail/sandbox.c | |
parent | Add a profile for dolphin-emu (diff) | |
download | firejail-411279afc10f58c9ee8a7e5599bd96c5ff32cd6c.tar.gz firejail-411279afc10f58c9ee8a7e5599bd96c5ff32cd6c.tar.zst firejail-411279afc10f58c9ee8a7e5599bd96c5ff32cd6c.zip |
a more portable implementation for time measurements
Diffstat (limited to 'src/firejail/sandbox.c')
-rw-r--r-- | src/firejail/sandbox.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c index 41951f38f..5c7b5e556 100644 --- a/src/firejail/sandbox.c +++ b/src/firejail/sandbox.c | |||
@@ -400,19 +400,8 @@ static int monitor_application(pid_t app_pid) { | |||
400 | } | 400 | } |
401 | 401 | ||
402 | static void print_time(void) { | 402 | static void print_time(void) { |
403 | if (start_timestamp) { | 403 | float delta = timetrace_end(); |
404 | unsigned long long end_timestamp = getticks(); | 404 | fmessage("Child process initialized in %.02f ms\n", delta); |
405 | // measure 1 ms | ||
406 | usleep(1000); | ||
407 | unsigned long long onems = getticks() - end_timestamp; | ||
408 | if (onems) { | ||
409 | fmessage("Child process initialized in %.02f ms\n", | ||
410 | (float) (end_timestamp - start_timestamp) / (float) onems); | ||
411 | return; | ||
412 | } | ||
413 | } | ||
414 | |||
415 | fmessage("Child process initialized\n"); | ||
416 | } | 405 | } |
417 | 406 | ||
418 | 407 | ||