#include <stdio.h>
#include <string.h>
+#include <stdlib.h> /* atoi */
#include <dlt/dlt.h>
#include <dlt/dlt_common.h>
{
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;
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],
/// 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");
resolution = ((clockRes.tv_sec * SECONDS2NANO) + clockRes.tv_nsec);
printf("Clock resolution => %f ms\n\n", (double)((double)resolution/NANO2MIL));
-
init_benchmark(1000);