diff options
author | 2016-08-15 11:12:27 -0400 | |
---|---|---|
committer | 2016-08-15 11:12:40 -0400 | |
commit | c379999665febd12ec55bfb3a7545224f2b39d3d (patch) | |
tree | 8bf0c11e52c2162e1239b6c3f4a5f74b62a07409 /vppinfra/vppinfra/test_time.c | |
parent | b3d93dacfde8ab21bbce171fff2971b2ed7bce6a (diff) |
VPP-327 Coding standards cleanup for vppinfra
Fix additional a few additional deviations reported elsewhere by
checkstyle
Change-Id: I026a8ae1c5b1856bbe3c4a555e1b690e7501b045
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vppinfra/vppinfra/test_time.c')
-rw-r--r-- | vppinfra/vppinfra/test_time.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/vppinfra/vppinfra/test_time.c b/vppinfra/vppinfra/test_time.c index 08c2e9e6349..63cfeac5b0a 100644 --- a/vppinfra/vppinfra/test_time.c +++ b/vppinfra/vppinfra/test_time.c @@ -37,13 +37,14 @@ #include <vppinfra/format.h> #include <vppinfra/time.h> -#include <vppinfra/math.h> /* for sqrt */ +#include <vppinfra/math.h> /* for sqrt */ static int verbose; #define if_verbose(format,args...) \ if (verbose) { clib_warning(format, ## args); } -static int test_time_main (unformat_input_t * input) +static int +test_time_main (unformat_input_t * input) { f64 wait, error; f64 t, tu[3], ave, rms; @@ -57,28 +58,30 @@ static int test_time_main (unformat_input_t * input) ave = rms = 0; tu[0] = unix_time_now (); tu[1] = unix_time_now (); - for (i = 0; i < n; i++) { - j = 0; - t = clib_time_now (&c); - while (clib_time_now (&c) < t + wait) - j++; - t = j; - ave += t; - rms += t*t; - } + for (i = 0; i < n; i++) + { + j = 0; + t = clib_time_now (&c); + while (clib_time_now (&c) < t + wait) + j++; + t = j; + ave += t; + rms += t * t; + } tu[2] = unix_time_now (); ave /= n; - rms = sqrt (rms/n - ave*ave); + rms = sqrt (rms / n - ave * ave); - error = ((tu[2] - tu[1]) - 2 * (tu[1] - tu[0]) - n*wait) / n; - if_verbose ("tested %d x %.6e sec waits, error %.6e loops %.6e +- %.6e\n", - n, wait, error, ave, rms); + error = ((tu[2] - tu[1]) - 2 * (tu[1] - tu[0]) - n * wait) / n; + if_verbose ("tested %d x %.6e sec waits, error %.6e loops %.6e +- %.6e\n", + n, wait, error, ave, rms); return 0; } #ifdef CLIB_UNIX -int main (int argc, char * argv[]) +int +main (int argc, char *argv[]) { unformat_input_t i; int ret; @@ -91,3 +94,11 @@ int main (int argc, char * argv[]) return ret; } #endif /* CLIB_UNIX */ + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ |