11#include "../_cexports/c_utilities.h"
13#include "../global.hpp"
17#include "utilities.hpp"
18#include "system_info.hpp"
26inline HandleGuard<Utilities::StopWatch>::HandleGuard(
void * handle) noexcept
27 : HandleGuard<Utilities::StopWatch>(handle, [](
void* handle) { CVB_CALL_CAPI(TWDestroy(handle)); })
61 auto stopWatch = Internal::DoBoolCallObjectOut<StopWatch>([&](
void* & handle)
67 return CVB_CALL_CAPI(TWCreateEx(&handle));
70 return CVB_CALL_CAPI(TWCreate(&handle));
106 return handle_.Handle();
138 if(!CVB_CALL_CAPI(TWStartStopWatch(
Handle(),
static_cast<short>(0))))
139 SystemInfo::ThrowLastError();
150 if(!CVB_CALL_CAPI(TWReadStopWatch(
Handle(),
static_cast<short>(0), &value)))
151 SystemInfo::ThrowLastError();
170 : handle_(std::move(guard))
175 HandleGuard<StopWatch> handle_;
183using Utilities::StopWatch;
Speed measurement object.
Definition: stop_watch.hpp:47
void Start()
Start (or re-start) the stopwatch.
Definition: stop_watch.hpp:136
std::chrono::milliseconds TimeSpan() const
Gets the time, that has elapsed since start (or since the construction of the object,...
Definition: stop_watch.hpp:147
static std::unique_ptr< StopWatch > FromHandle(HandleGuard< StopWatch > &&guard, StopWatchMode mode)
Creates a stop watch from a classic API handle.
Definition: stop_watch.hpp:119
StopWatch(StopWatchMode mode=StopWatchMode::MultiCPU)
Create a StopWatch object.
Definition: stop_watch.hpp:85
static std::unique_ptr< StopWatch > Create(StopWatchMode mode=StopWatchMode::MultiCPU)
Create a StopWatch object.
Definition: stop_watch.hpp:59
void * Handle() const noexcept
Classic API stop watch handle.
Definition: stop_watch.hpp:104
StopWatchMode Mode() const noexcept
Mode for which the stop watch was created.
Definition: stop_watch.hpp:160
StopWatchMode
Mode at which the StopWatch should work.
Definition: utilities.hpp:31
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24