diff --git a/libsrc/core/profiler.hpp b/libsrc/core/profiler.hpp index 0b647d82..c7a60af9 100644 --- a/libsrc/core/profiler.hpp +++ b/libsrc/core/profiler.hpp @@ -188,6 +188,8 @@ namespace ngcore Timer( const std::string & name, TTracing, TTiming ) : timernr(Init(name)) { } + [[deprecated ("Use Timer(name, NoTracing/NoTiming) instead")]] Timer( const std::string & name, int ) : timernr(Init(name)) {} + void SetName (const std::string & name) { NgProfiler::SetName (timernr, name); @@ -276,6 +278,25 @@ namespace ngcore void operator=(RegionTimer &&) = delete; }; + class [[deprecated("Use RegionTimer instead (now thread safe)")]] ThreadRegionTimer + { + size_t nr; + size_t tid; + public: + /// start timer + ThreadRegionTimer (size_t _nr, size_t _tid) : nr(_nr), tid(_tid) + { NgProfiler::StartThreadTimer(nr, tid); } + /// stop timer + ~ThreadRegionTimer () + { NgProfiler::StopThreadTimer(nr, tid); } + + ThreadRegionTimer() = delete; + ThreadRegionTimer(ThreadRegionTimer &&) = delete; + ThreadRegionTimer(const ThreadRegionTimer &) = delete; + void operator=(const ThreadRegionTimer &) = delete; + void operator=(ThreadRegionTimer &&) = delete; + }; + class RegionTracer { int nr;