Summary

Basically, the itk::TimeProbe instance in GDALImageIO sometimes shows up in the profiles. Here is a summary of the changes:

The first commit adds an otb::Stopwatch class which uses std::chrono::steady_clock. Its API is heavily inspired from .NET’s Stopwatch. It doesn’t have itk::TimeProbe’s feature of keeping a sample list and doesn’t compute the mean time and iteration count.

The second commit replaces TimeProbe with Stopwatch, the changes are mostly mechanical, with a couple of exceptions:

Some places used GetMean instead of GetTotal even if the TimeProbe was only started once

The stopwatch doesn’t have to be stopped to get the elapsed time, but I left in Stop() calls in some places to avoid compiler warnings under Release configurations

Most of the changed code is in otbMsgDevMacro calls or in test applications

I changed the unit in a couple of places, e.g. GDALImageIO::{Read,Write} printed seconds, while milliseconds are probably more appropriate for those operations

I changed the value from the average to the total in a couple of places, e.g. OGRIOHelper::ConvertOGRLayerToDataTreeNode which displayed the total number of features and the average time and now shows the total time

Some operations stopped and restarted the timer, but I made it wrap the whole processing, e.g. OGRIOHelper::ConvertOGRLayerToDataTreeNode or otbLabelObjectMapVectorizer.cxx

I made a couple of indentation fixes / changes where it was misleading

Compile tested under RelWithDebInfo.

Note on the API: in classes otb::FilterWatcherBase and otb::WriterWatcherBase, the function GetTimeProbe() has been replaced by GetStopwatch(). However, these functions are never called inside OTB.