1 //===- Timer.h ----------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLD_COMMON_TIMER_H
10 #define LLD_COMMON_TIMER_H
12 #include "llvm/ADT/DenseMap.h"
13 #include "llvm/ADT/StringRef.h"
24 explicit ScopedTimer(Timer &t);
35 Timer(llvm::StringRef name, Timer &parent);
43 double millis() const;
46 explicit Timer(llvm::StringRef name);
47 void print(int depth, double totalDuration, bool recurse = true) const;
49 std::chrono::time_point<std::chrono::high_resolution_clock> startTime;
50 std::chrono::nanoseconds total;
51 std::vector<Timer *> children;