diff options
author | Ingo Huerner <ingo.huerner@xse.de> | 2014-06-30 17:39:25 +0200 |
---|---|---|
committer | Ingo Huerner <ingo.huerner@xse.de> | 2014-06-30 17:39:25 +0200 |
commit | d1bbdc90f47ba965cf128340fa7551b65dc71263 (patch) | |
tree | 2a4b9ae072b3eff56dac7ab936f65ff730fa739f | |
parent | 2ecacbf0c7fd4255ef52b5a63cab97c85a573d80 (diff) | |
download | persistence-client-library-d1bbdc90f47ba965cf128340fa7551b65dc71263.tar.gz |
Updated benchmark
-rw-r--r-- | test/persistence_client_library_benchmark.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/test/persistence_client_library_benchmark.c b/test/persistence_client_library_benchmark.c index 05d1b27..aa2032e 100644 --- a/test/persistence_client_library_benchmark.c +++ b/test/persistence_client_library_benchmark.c @@ -22,6 +22,7 @@ #include <stdio.h> #include <string.h> +#include <stdlib.h> /* atoi */ #include <dlt/dlt.h> #include <dlt/dlt_common.h> @@ -429,9 +430,9 @@ int main(int argc, char *argv[]) { int ret = 0; -#if 0 +#if 1 unsigned int shutdownReg = PCL_SHUTDOWN_TYPE_FAST | PCL_SHUTDOWN_TYPE_NORMAL; - int numLoops = 5000; + int numLoops = 500; // number of default loops long long resolution = 0; struct timespec clockRes; @@ -447,6 +448,20 @@ int main(int argc, char *argv[]) struct tm *locTime; + int opt; + + while ((opt = getopt(argc, argv, "l:")) != -1) + { + switch (opt) + { + case 'l': + numLoops = atoi(optarg); + break; + } + } + + printf("Number of loops: %d\n", numLoops); + time_t t = time(0); locTime = localtime(&t); snprintf(sysTimeBuffer, BUFFER_SIZE, "The benchmark string to do write benchmarking: \"%s %.2d.%.2d.%d - %d:%.2d:%.2d Uhr\" [time and date]", dayOfWeek[locTime->tm_wday], @@ -460,10 +475,10 @@ int main(int argc, char *argv[]) /// debug log and trace (DLT) setup - DLT_REGISTER_APP("noty","tests the persistence client library"); + DLT_REGISTER_APP("PCLb","tests the persistence client library"); -#if 0 +#if 1 printf("\n\n============================\n"); printf(" PCL benchmark\n"); printf("============================\n\n"); @@ -472,7 +487,6 @@ int main(int argc, char *argv[]) resolution = ((clockRes.tv_sec * SECONDS2NANO) + clockRes.tv_nsec); printf("Clock resolution => %f ms\n\n", (double)((double)resolution/NANO2MIL)); - init_benchmark(1000); |