From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_wall_clock_timer_8hpp_source.xhtml | 123 ++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 20.02/_wall_clock_timer_8hpp_source.xhtml (limited to '20.02/_wall_clock_timer_8hpp_source.xhtml') diff --git a/20.02/_wall_clock_timer_8hpp_source.xhtml b/20.02/_wall_clock_timer_8hpp_source.xhtml new file mode 100644 index 0000000000..28a6d13c49 --- /dev/null +++ b/20.02/_wall_clock_timer_8hpp_source.xhtml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/WallClockTimer.hpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
WallClockTimer.hpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "Instrument.hpp"
9 #include <chrono>
10 #include "DllExport.hpp"
11 
12 namespace armnn
13 {
14 
15 #if defined(CLOCK_MONOTONIC_RAW) && defined(__unix__)
16 #define USE_CLOCK_MONOTONIC_RAW 1
17 #else
18 #define USE_CLOCK_MONOTONIC_RAW 0
19 #endif
20 
21 #if USE_CLOCK_MONOTONIC_RAW
22 class MonotonicClockRaw
23 {
24 public:
25  using duration = std::chrono::nanoseconds;
26  using time_point = std::chrono::time_point<MonotonicClockRaw, duration>;
27 
28  static std::chrono::time_point<MonotonicClockRaw, std::chrono::nanoseconds> now() noexcept
29  {
30  timespec ts;
31  clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
32  return time_point(std::chrono::nanoseconds(ts.tv_sec * 1000000000 + ts.tv_nsec));
33  }
34 };
35 #endif
36 
37 // Implementation of an instrument to measure elapsed wall-clock time in microseconds.
38 class WallClockTimer : public Instrument
39 {
40 public:
41  // Construct a Wall Clock Timer
42  WallClockTimer() = default;
43  ~WallClockTimer() = default;
44 
45  // Start the Wall clock timer
46  void Start() override;
47 
48  // Stop the Wall clock timer
49  void Stop() override;
50 
51  // Get the name of the timer
52  const char* GetName() const override;
53 
54  // Get the recorded measurements
55  std::vector<Measurement> GetMeasurements() const override;
56 
57 #if USE_CLOCK_MONOTONIC_RAW
58  using clock = MonotonicClockRaw;
59 #else
60  using clock = std::chrono::steady_clock;
61 #endif
62 
63  ARMNN_DLLEXPORT static const std::string WALL_CLOCK_TIME;
64  static const std::string WALL_CLOCK_TIME_START;
65  static const std::string WALL_CLOCK_TIME_STOP;
66 
67 private:
68  clock::time_point m_Start;
69  clock::time_point m_Stop;
70 };
71 
72 } //namespace armnn
+
Copyright (c) 2020 ARM Limited.
+
#define ARMNN_DLLEXPORT
Definition: DllExport.hpp:17
+
static const std::string WALL_CLOCK_TIME_STOP
+
static const std::string WALL_CLOCK_TIME_START
+
static const std::string WALL_CLOCK_TIME
+
std::chrono::steady_clock clock
+ + + +
+
+ + + + -- cgit v1.2.1