From 625c2ef159b735a9a64d7da6ad4c10e81b464fae Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 9 Jan 2023 13:14:47 -0800 Subject: [PATCH] epicsThreadPerform: time epicsThreadOnce() --- modules/libcom/test/epicsThreadPerform.cpp | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/modules/libcom/test/epicsThreadPerform.cpp b/modules/libcom/test/epicsThreadPerform.cpp index 07238cb33..3b7baef2d 100644 --- a/modules/libcom/test/epicsThreadPerform.cpp +++ b/modules/libcom/test/epicsThreadPerform.cpp @@ -216,6 +216,42 @@ static void timeEpicsThreadPrivateGet () printf("epicsThreadPrivateGet() takes %f microseconds\n", delay); } +static void onceAction(void*) {} + +static void timeOnce () +{ +#define NITER 100 + epicsThreadOnceId once[NITER]; + double tSlow = 0.0, tFast = 0.0, + tSlow2= 0.0, tFast2= 0.0; + unsigned i; + + for(i=0; i