FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
multi-party-ecdsa-cpp/test/CTimer.cpp at main · robot-python/multi-party-ecdsa-cpp · GitHub
robot-python
/
multi-party-ecdsa-cpp
Public
forked from
Safeheron/multi-party-sig-cpp
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
multi-party-ecdsa-cpp
/
test
/
CTimer.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (33 loc) · 1.22 KB
Breadcrumbs
multi-party-ecdsa-cpp
/
test
/
CTimer.cpp
Copy path
File metadata and controls
38 lines (33 loc) · 1.22 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
//
//
Created by Sword03 on 2022/6/23.
//
#
include
"
CTimer.h
"
#
include
<
chrono
>
#
include
<
iostream
>
CTimer::CTimer
(std::string name) {
is_triggered_ =
false
;
name_ = name;
std::cout <<
"
Timer start ------
"
<< name_.
c_str
() << std::endl;
begin_ =
std::chrono::high_resolution_clock::now
();
}
void
CTimer::Reset
(std::string name) {
is_triggered_ =
false
;
name_ = name;
std::cout <<
"
Timer reset ------
"
<< name_.
c_str
() << std::endl;
begin_ =
std::chrono::high_resolution_clock::now
();
}
void
CTimer::End
() {
if
(!is_triggered_){
std::chrono::high_resolution_clock::time_point end =
std::chrono::high_resolution_clock::now
();
std::chrono::duration<
double
> duration = end - begin_;
std::cout <<
"
Timer end ------
"
<< name_.
c_str
() <<
"
"
<< std::chrono::duration<
double
>(duration).
count
() << std::endl;
is_triggered_ =
true
;
}
}
CTimer::~CTimer
() {
if
(!is_triggered_){
std::chrono::high_resolution_clock::time_point end =
std::chrono::high_resolution_clock::now
();
std::chrono::duration<
double
> duration = end - begin_;
std::cout <<
"
Timer end ------
"
<< name_.
c_str
() <<
"
"
<< std::chrono::duration<
double
>(duration).
count
() << std::endl;
}
}
Back
|
FazBrowse Home
|
New Git URL