[tracker/parser-unicode-libs-review: 83/85] Add timer in tester



commit 23a5332fe907ead9b47650d41876909597ca8b6f
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue May 4 17:49:10 2010 +0200

    Add timer in tester

 src/libtracker-fts/tracker-parser-libicu.c |    2 +-
 tests/libtracker-fts/tracker-parser-test.c |    9 +++++++++
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-fts/tracker-parser-libicu.c b/src/libtracker-fts/tracker-parser-libicu.c
index 6414d40..40e740b 100644
--- a/src/libtracker-fts/tracker-parser-libicu.c
+++ b/src/libtracker-fts/tracker-parser-libicu.c
@@ -42,7 +42,7 @@
                           ((c) >= 0x4E00 && (c) <= 0x9FA5)  || \
                           ((c) >= 0x20000 && (c) <= 0x2A6D6))
 
-/* Max possible length of a UTF-8 encoded string (just a safety limit) */
+/* Max possible length of a UChar encoded string (just a safety limit) */
 #define WORD_BUFFER_LENGTH 512
 
 
diff --git a/tests/libtracker-fts/tracker-parser-test.c b/tests/libtracker-fts/tracker-parser-test.c
index 41d7cc5..463b004 100644
--- a/tests/libtracker-fts/tracker-parser-test.c
+++ b/tests/libtracker-fts/tracker-parser-test.c
@@ -114,6 +114,10 @@ run_parsing (void)
 {
 	TrackerLanguage *language;
 	TrackerParser   *parser;
+	GTimer          *timer;
+
+	/* Initialize timing */
+	timer = g_timer_new ();
 
 	/* Setup language for parser */
 	language = tracker_language_new (NULL);
@@ -197,6 +201,11 @@ run_parsing (void)
 		g_free (original_word);
 	}
 
+	g_print ("\n----> Parsing finished after '%lf' seconds\n",
+	         g_timer_elapsed (timer, NULL));
+
+	g_timer_destroy (timer);
+
 	tracker_parser_free (parser);
 	g_object_unref (language);
 	return TRUE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]