[ostree] triggers: Print execution time for each trigger
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] triggers: Print execution time for each trigger
- Date: Sun, 5 Aug 2012 20:40:54 +0000 (UTC)
commit 179fc65947c2df117d2b28ff245c73f15d134fbf
Author: Colin Walters <walters verbum org>
Date: Sun Aug 5 08:50:33 2012 -0400
triggers: Print execution time for each trigger
src/triggers/ostree-run-triggers.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/triggers/ostree-run-triggers.c b/src/triggers/ostree-run-triggers.c
index bf3df47..472ca96 100644
--- a/src/triggers/ostree-run-triggers.c
+++ b/src/triggers/ostree-run-triggers.c
@@ -173,6 +173,8 @@ run_triggers (GCancellable *cancellable,
{
const char *basename;
GFile *trigger_path = triggers->pdata[i];
+ guint64 start_time;
+ guint64 end_time;
g_free (path);
path = g_file_get_path (trigger_path);
@@ -182,9 +184,13 @@ run_triggers (GCancellable *cancellable,
else
basename = path;
- g_print ("ostree-run-triggers: %s\n", basename);
+ start_time = g_get_monotonic_time ();
+ g_print ("ostree-run-triggers: Starting: %s\n", basename);
if (!run_trigger (path, cancellable, error))
goto out;
+ end_time = g_get_monotonic_time ();
+ g_print ("ostree-run-triggers: Completed %s in %.2f seconds\n", basename,
+ (double) (end_time - start_time) / (double)G_USEC_PER_SEC);
}
ret = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]