xref: /freebsd-src/contrib/llvm-project/llvm/include/llvm/Support/Duration.h (revision 04eeddc0aa8e0a417a16eaf9d7d095207f4a8623)
1*04eeddc0SDimitry Andric //===--- Duration.h - wrapper around std::chrono::Duration ------*- C++ -*-===//
2*04eeddc0SDimitry Andric //
3*04eeddc0SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*04eeddc0SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*04eeddc0SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*04eeddc0SDimitry Andric //
7*04eeddc0SDimitry Andric //===----------------------------------------------------------------------===//
8*04eeddc0SDimitry Andric //
9*04eeddc0SDimitry Andric //  The sole purpose of this file is to avoid the dependency on <chrono> in
10*04eeddc0SDimitry Andric //  raw_ostream.
11*04eeddc0SDimitry Andric //
12*04eeddc0SDimitry Andric //===----------------------------------------------------------------------===//
13*04eeddc0SDimitry Andric 
14*04eeddc0SDimitry Andric #ifndef LLVM_SUPPORT_DURATION_H
15*04eeddc0SDimitry Andric #define LLVM_SUPPORT_DURATION_H
16*04eeddc0SDimitry Andric 
17*04eeddc0SDimitry Andric #include <chrono>
18*04eeddc0SDimitry Andric 
19*04eeddc0SDimitry Andric namespace llvm {
20*04eeddc0SDimitry Andric class Duration {
21*04eeddc0SDimitry Andric   std::chrono::milliseconds Value;
22*04eeddc0SDimitry Andric   public:
Duration(std::chrono::milliseconds Value)23*04eeddc0SDimitry Andric   Duration(std::chrono::milliseconds Value) : Value(Value) {}
getDuration()24*04eeddc0SDimitry Andric   std::chrono::milliseconds getDuration() const { return Value; }
25*04eeddc0SDimitry Andric };
26*04eeddc0SDimitry Andric }
27*04eeddc0SDimitry Andric 
28*04eeddc0SDimitry Andric #endif
29