mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 22:06:06 +00:00

This reverts commit 2e9bcadb7c8acaa8f6ec7d807e5666246923e468. Differential Revision: https://reviews.llvm.org/D146772
30 lines
787 B
C++
30 lines
787 B
C++
//===-- timing.cpp ----------------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "timing.h"
|
|
|
|
namespace scudo {
|
|
|
|
Timer::~Timer() {
|
|
if (Manager)
|
|
Manager->report(*this);
|
|
}
|
|
|
|
ScopedTimer::ScopedTimer(TimingManager &Manager, const char *Name)
|
|
: Timer(Manager.getOrCreateTimer(Name)) {
|
|
start();
|
|
}
|
|
|
|
ScopedTimer::ScopedTimer(TimingManager &Manager, const Timer &Nest,
|
|
const char *Name)
|
|
: Timer(Manager.nest(Nest, Name)) {
|
|
start();
|
|
}
|
|
|
|
} // namespace scudo
|