From c5026341075050ca345d4e85bf9710ca4bed5682 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 29 Apr 2008 14:07:18 +0200 Subject: [PATCH] Measure time of the journal creation. --- src/csync.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/csync.c b/src/csync.c index 20dc8018bc..6881a0d1a5 100644 --- a/src/csync.c +++ b/src/csync.c @@ -315,6 +315,7 @@ static void tree_destructor(void *data) { } int csync_destroy(CSYNC *ctx) { + time_t start, finish; char *lock = NULL; char *journal = NULL; int jwritten = 0; @@ -331,8 +332,13 @@ int csync_destroy(CSYNC *ctx) { ctx->status = CSYNC_DONE; if (ctx->status & CSYNC_DONE) { + time(&start); if (csync_journal_write(ctx) == 0) { jwritten = 1; + time(&finish); + CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, + "Writing the journal to disk took %.2f seconds", + difftime(finish, start)); } else { CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Unable to write journal: %s", strerror(errno));