mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
backward-compatible Timer interface
This commit is contained in:
parent
1b5aa71ad6
commit
4b40a7eb31
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user