Duration.h 1023 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- Duration.h - wrapper around std::chrono::Duration ------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // The sole purpose of this file is to avoid the dependency on <chrono> in
  15. // raw_ostream.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_SUPPORT_DURATION_H
  19. #define LLVM_SUPPORT_DURATION_H
  20. #include <chrono>
  21. namespace llvm {
  22. class Duration {
  23. std::chrono::milliseconds Value;
  24. public:
  25. Duration(std::chrono::milliseconds Value) : Value(Value) {}
  26. std::chrono::milliseconds getDuration() const { return Value; }
  27. };
  28. }
  29. #endif
  30. #ifdef __GNUC__
  31. #pragma GCC diagnostic pop
  32. #endif