Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OpenGL
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
C-Fu
OpenGL
Commits
d1c68e8b
Commit
d1c68e8b
authored
8 years ago
by
Anakin
Browse files
Options
Downloads
Patches
Plain Diff
added Profiler to analyses the time used by code lines
parent
9c16aa32
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
QtMeshViewer/Header/Profiler.h
+36
-0
36 additions, 0 deletions
QtMeshViewer/Header/Profiler.h
QtMeshViewer/Source/GeometryEngine.cpp
+1
-0
1 addition, 0 deletions
QtMeshViewer/Source/GeometryEngine.cpp
QtMeshViewer/Source/OglViewerWidget.cpp
+2
-0
2 additions, 0 deletions
QtMeshViewer/Source/OglViewerWidget.cpp
with
39 additions
and
0 deletions
QtMeshViewer/Header/Profiler.h
0 → 100644
+
36
−
0
View file @
d1c68e8b
#pragma once
#ifdef _DEBUG
#include
<QElapsedTimer.h>
#include
<iostream>
#define TIC Profiler::getInstance().startTimer();
#define TOC Profiler::getInstance().takeTime();
class
Profiler
{
private:
Profiler
()
{
timer
.
start
();
};
QElapsedTimer
timer
;
public
:
~
Profiler
()
{};
static
Profiler
&
getInstance
()
{
static
Profiler
instance
;
return
instance
;
}
void
startTimer
()
{
timer
.
restart
();
};
void
takeTime
()
{
std
::
cout
<<
"time elapsed: "
<<
timer
.
elapsed
()
<<
std
::
endl
;
};
};
#else
#define TIC
#define TOC
#endif
This diff is collapsed.
Click to expand it.
QtMeshViewer/Source/GeometryEngine.cpp
+
1
−
0
View file @
d1c68e8b
...
...
@@ -5,6 +5,7 @@
#include
"..\Header\OutputDevice.h"
#include
<QRegExp>
#include
"../Header/Profiler.h"
/////////////////////////////////////////////////////////////////////////
// constructor/destructor
...
...
This diff is collapsed.
Click to expand it.
QtMeshViewer/Source/OglViewerWidget.cpp
+
2
−
0
View file @
d1c68e8b
...
...
@@ -4,6 +4,8 @@
#include
<QDropEvent>
#include
<QMimeData>
#include
"..\Header\Profiler.h"
#define DEFAULT_Z_DISTANCE -4.0
...
...
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