IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pranav Sampathkumar
corsika
Commits
acf5664c
Commit
acf5664c
authored
4 years ago
by
Dominik Baack
Committed by
Ralf Ulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added more functionality to ExecTime
parent
5030e6e5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Processes/DevTools/Analytics/ExecTime.cc
+42
-2
42 additions, 2 deletions
Processes/DevTools/Analytics/ExecTime.cc
Processes/DevTools/Analytics/ExecTime.h
+14
-6
14 additions, 6 deletions
Processes/DevTools/Analytics/ExecTime.h
with
56 additions
and
8 deletions
Processes/DevTools/Analytics/ExecTime.cc
+
42
−
2
View file @
acf5664c
...
...
@@ -15,10 +15,50 @@ namespace corsika::process {
namespace
devtools
{
template
<
class
T
>
void
ExecTime
<
T
>::
start
()
{}
void
ExecTime
<
T
>::
start
()
{
fStart
=
std
::
chrono
::
steady_clock
::
now
();
}
template
<
class
T
>
void
ExecTime
<
T
>::
stop
()
{}
void
ExecTime
<
T
>::
stop
()
{
auto
end
=
std
::
chrono
::
steady_clock
::
now
();
std
::
chrono
::
microseconds
timeDiv
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
end
-
start
);
fElapsedSum
+=
timeDiv
;
fN
++
;
if
(
fMax
<
timeDiv
)
fMax
=
timeDiv
;
if
(
timeDiv
<
fMin
)
fMin
=
timeDiv
;
auto
delta
=
timeDiv
-
fMean
;
fMean
+=
delta
/
fN
;
auto
delta2
=
timeDiv
-
fMean
;
fMean2
+=
delta
*
delta2
;
}
template
<
typename
T
>
double
ExecTime
<
T
>::
mean
()
{
return
fMean
;
}
template
<
typename
T
>
double
ExecTime
<
T
>::
var
()
{
return
fMean2
/
count
;
}
template
<
typename
T
>
double
ExecTime
<
T
>::
min
()
{
return
fMin
;
}
template
<
typename
T
>
double
ExecTime
<
T
>::
max
()
{
return
fMax
;
}
}
// namespace devtools
}
// namespace corsika::process
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Processes/DevTools/Analytics/ExecTime.h
+
14
−
6
View file @
acf5664c
...
...
@@ -108,22 +108,30 @@ namespace corsika::process {
std
::
is_base_of
<
BoundaryCrossingProcess
<
typename
T
::
_TDerived
>
,
T
>::
value
>
,
public
ExecTime_Continuous
<
T
,
std
::
is_base_of
<
ContinuousProcess
<
typename
T
::
_TDerived
>
,
T
>::
value
>
,
public
ExecTime_Decay
<
T
,
std
::
is_base_of
<
DecayProcess
<
typename
T
::
_TDerived
>
,
T
>::
value
>
,
public
ExecTime_Decay
<
T
,
std
::
is_base_of
<
DecayProcess
<
typename
T
::
_TDerived
>
,
T
>::
value
>
,
public
ExecTime_Interaction
<
T
,
std
::
is_base_of
<
InteractionProcess
<
typename
T
::
_TDerived
>
,
T
>::
value
>
,
public
ExecTime_Secondaries
<
T
,
std
::
is_base_of
<
SecondariesProcess
<
typename
T
::
_TDerived
>
,
T
>::
value
>
{
private:
std
::
chrono
::
microseconds
fStart
;
std
::
chrono
::
microseconds
fElapsedSum
;
std
::
chrono
::
microseconds
fMean
;
std
::
chrono
::
microseconds
fMean2
;
std
::
chrono
::
microseconds
fMin
;
std
::
chrono
::
microseconds
fMax
;
long
long
fN
;
void
start
();
void
stop
();
protected:
public:
float
mean
();
float
min
();
float
max
();
float
var
();
double
mean
();
double
min
();
double
max
();
double
var
();
/*
// Stack
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment