summaryrefslogtreecommitdiff
path: root/src/cgg.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-04-11 15:43:15 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-04-11 15:43:15 +0200
commit9c2c964727e4a484acf7f97267a3cf1c8fbacd89 (patch)
tree261f5ffe6954aaecb2f7ad29edfa459ae0971148 /src/cgg.c
parent6a54c7817bb71fde9234e7b89e87f1f349920ea1 (diff)
downloadcataract-9c2c964727e4a484acf7f97267a3cf1c8fbacd89.tar.xz
Print statistics in verbose mode
Diffstat (limited to 'src/cgg.c')
-rw-r--r--src/cgg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cgg.c b/src/cgg.c
index 92debc8..f5776b4 100644
--- a/src/cgg.c
+++ b/src/cgg.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
+#include <time.h>
#include <glib.h>
#include <glib/gthread.h>
@@ -32,6 +33,7 @@
#include "setup.h"
#include "job-manager.h"
+#include "stats.h"
@@ -106,6 +108,8 @@ main(int argc, char* argv[])
gboolean verbose;
int jobs;
TGallerySetup *setup;
+ time_t time_start = time (NULL);
+ time_t time_stop;
/*
* this initialize the library and check potential ABI mismatches
@@ -151,10 +155,28 @@ main(int argc, char* argv[])
}
+ stats_errors = 0;
+ stats_dirs = 0;
+ stats_images = 0;
+
+ /* Print banner */
+ if (verbose)
+ printf ("cgg v%s [%s]\n\n", VERSION, APP_BUILD_DATE);
+
/* Start building the gallery tree */
setup->verbose = verbose;
build_tree (setup, source_dir, dst_dir, NULL, -1, jobs);
+ if (verbose) {
+ time_stop = time (NULL);
+ printf ("\nProcessed %d images in %d albums, elapsed time = %dm %ds\n", stats_images, stats_dirs, (int) ((time_stop - time_start) / 60), (int) ((time_stop - time_start) % 60));
+ if (stats_errors == 1)
+ printf ("%d error occured.\n", stats_errors);
+ if (stats_errors > 1)
+ printf ("%d errors occured.\n", stats_errors);
+ }
+
+
MagickWandTerminus();