diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
commit | 3d7fefedc9ba60bd8e8448efe8b628446d958536 (patch) | |
tree | 61ce41a52cd6e7232cead77818ef265993b2427e /src/util/test_speedup.c | |
parent | 4a0398474db197abed243a123fb971fbeeffab4b (diff) | |
download | gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.tar.gz gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.zip |
changing time measurement from milliseconds to microseconds
Diffstat (limited to 'src/util/test_speedup.c')
-rw-r--r-- | src/util/test_speedup.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/util/test_speedup.c b/src/util/test_speedup.c index 03cffbd54..a2e6bb29c 100644 --- a/src/util/test_speedup.c +++ b/src/util/test_speedup.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2001, 2002, 2003, 2004, 2006, 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2011-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -22,10 +22,7 @@ | |||
22 | * @brief testcase for speedup.c | 22 | * @brief testcase for speedup.c |
23 | */ | 23 | */ |
24 | #include "platform.h" | 24 | #include "platform.h" |
25 | #include "gnunet_common.h" | 25 | #include "gnunet_util_lib.h" |
26 | #include "gnunet_program_lib.h" | ||
27 | #include "gnunet_time_lib.h" | ||
28 | #include "gnunet_strings_lib.h" | ||
29 | 26 | ||
30 | /** | 27 | /** |
31 | * Start time of the testcase | 28 | * Start time of the testcase |
@@ -100,19 +97,23 @@ main (int argc, char *argv[]) | |||
100 | "nohelp", options, &check, NULL); | 97 | "nohelp", options, &check, NULL); |
101 | 98 | ||
102 | end_real = time (NULL); | 99 | end_real = time (NULL); |
103 | delta = GNUNET_TIME_absolute_get_difference(start, end); | 100 | delta = GNUNET_TIME_absolute_get_difference (start, end); |
104 | 101 | ||
105 | if (delta.rel_value > ((end_real - start_real) * 1500LL)) | 102 | if (delta.rel_value_us > ((end_real - start_real) * 1500LL * 1000LL)) |
106 | { | 103 | { |
107 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Execution time in GNUnet time: %llu ms\n", | 104 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
108 | (unsigned long long) delta.rel_value); | 105 | "Execution time in GNUnet time: %s\n", |
109 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Execution time in system time: %llu ms\n", | 106 | GNUNET_STRINGS_relative_time_to_string (delta, GNUNET_YES)); |
107 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
108 | "Execution time in system time: %llu ms\n", | ||
110 | (unsigned long long) ((end_real - start_real) * 1000LL)); | 109 | (unsigned long long) ((end_real - start_real) * 1000LL)); |
111 | return 0; | 110 | return 0; |
112 | } | 111 | } |
113 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Execution time in GNUnet time: %llu ms\n", | 112 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
114 | (unsigned long long) delta.rel_value); | 113 | "Execution time in GNUnet time: %s\n", |
115 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Execution time in system time: %llu ms\n", | 114 | GNUNET_STRINGS_relative_time_to_string (delta, GNUNET_YES)); |
115 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
116 | "Execution time in system time: %llu ms\n", | ||
116 | (unsigned long long) ((end_real - start_real) * 1000LL)); | 117 | (unsigned long long) ((end_real - start_real) * 1000LL)); |
117 | return 1; | 118 | return 1; |
118 | } | 119 | } |