003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lld/include/lld/Common
usr
/
src
/
contrib
/
llvm-project
/
lld
/
include
/
lld
/
Common
/
📁
..
📄
Args.h
(1.12 KB)
📄
DWARF.h
(1.36 KB)
📄
Driver.h
(1.41 KB)
📄
ErrorHandler.h
(6.01 KB)
📄
Filesystem.h
(599 B)
📄
LLVM.h
(2.56 KB)
📄
Memory.h
(2.37 KB)
📄
Reproduce.h
(1.01 KB)
📄
Strings.h
(2.48 KB)
📄
TargetOptionsCommandFlags.h
(887 B)
📄
Timer.h
(1.24 KB)
📄
Version.h
(750 B)
📄
Version.inc.in
(43 B)
Editing: Timer.h
//===- Timer.h ----------------------------------------------*- 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 // //===----------------------------------------------------------------------===// #ifndef LLD_COMMON_TIMER_H #define LLD_COMMON_TIMER_H #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringRef.h" #include <assert.h> #include <atomic> #include <chrono> #include <map> #include <memory> namespace lld { class Timer; struct ScopedTimer { explicit ScopedTimer(Timer &t); ~ScopedTimer(); void stop(); std::chrono::time_point<std::chrono::high_resolution_clock> startTime; Timer *t = nullptr; }; class Timer { public: Timer(llvm::StringRef name, Timer &parent); static Timer &root(); void addToTotal(std::chrono::nanoseconds time) { total += time.count(); } void print(); double millis() const; private: explicit Timer(llvm::StringRef name); void print(int depth, double totalDuration, bool recurse = true) const; std::atomic<std::chrono::nanoseconds::rep> total; std::vector<Timer *> children; std::string name; }; } // namespace lld #endif
Upload File
Create Folder