FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
visioncpp/include/framework/tools/time.hpp at master · codeplaysoftware/visioncpp · GitHub
This repository was archived by the owner on Apr 29, 2024. It is now read-only.
codeplaysoftware
visioncpp
Repository navigation
Code
Issues
Pull requests
1
(1)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
visioncpp
/
include
/
framework
/
tools
/
time.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (49 loc) · 1.8 KB
Breadcrumbs
visioncpp
/
include
/
framework
/
tools
/
time.hpp
Copy path
File metadata and controls
53 lines (49 loc) · 1.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
This file is part of VisionCpp, a lightweight C++ template library
//
for computer vision and image processing.
//
//
Copyright (C) 2016 Codeplay Software Limited. All Rights Reserved.
//
//
Contact: visioncpp@codeplay.com
//
//
Licensed under the Apache License, Version 2.0 (the "License");
//
you may not use this file except in compliance with the License.
//
You may obtain a copy of the License at
//
//
http://www.apache.org/licenses/LICENSE-2.0
//
//
Unless required by applicable law or agreed to in writing, software
//
distributed under the License is distributed on an "AS IS" BASIS,
//
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
See the License for the specific language governing permissions and
//
limitations under the License.
//
/ \file time.hpp
//
/ \brief Basic time operations
#
ifndef
VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_TIME_HPP_
#
define
VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_TIME_HPP_
#
include
<
chrono
>
namespace
visioncpp
{
namespace
internal
{
namespace
tools
{
//
/ function get_elapse_time
//
/ \brief it is used to calculate the time period in second.
//
/ template parameters
//
/ \tparam T : the type of the time from chrono
//
/ function parameters
//
/ \param begin : start of the time
//
/ \param end : end of the time
//
/ returns a double
template
<
typename
T>
double
get_elapse_time
(T begin, T end) {
return
std::chrono::duration<
double
, std::chrono::seconds::period>(
end - begin).
count
();
};
//
/ function get_current_time
//
/ \brief getting the current time from the system using chrono
//
/ \return std::chrono::high_resolution_clock::time_point
std::chrono::high_resolution_clock::time_point
get_current_time
() {
return
std::chrono::high_resolution_clock::now
();
}
}
//
tools
}
//
internal
}
//
visioncpp
#
endif
//
VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_TIME_HPP_
Back
|
FazBrowse Home
|
New Git URL