diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-04-11 15:43:15 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-04-11 15:43:15 +0200 |
| commit | 9c2c964727e4a484acf7f97267a3cf1c8fbacd89 (patch) | |
| tree | 261f5ffe6954aaecb2f7ad29edfa459ae0971148 /src/cgg.c | |
| parent | 6a54c7817bb71fde9234e7b89e87f1f349920ea1 (diff) | |
| download | cataract-9c2c964727e4a484acf7f97267a3cf1c8fbacd89.tar.xz | |
Print statistics in verbose mode
Diffstat (limited to 'src/cgg.c')
| -rw-r--r-- | src/cgg.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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(); |
