Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QML_Benchmark
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository 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
Daniel Smith
QML_Benchmark
Commits
f92240a8
Commit
f92240a8
authored
6 years ago
by
Daniel Smith
Browse files
Options
Downloads
Patches
Plain Diff
WIP: update frametime to print with QDebug
parent
7c47e1ce
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Heavy_QML_example.pro
+1
-1
1 addition, 1 deletion
Heavy_QML_example.pro
Heavy_QML_example.pro.user
+1
-1
1 addition, 1 deletion
Heavy_QML_example.pro.user
benchmark.cpp
+20
-4
20 additions, 4 deletions
benchmark.cpp
benchmark.h
+4
-3
4 additions, 3 deletions
benchmark.h
with
26 additions
and
9 deletions
Heavy_QML_example.pro
+
1
−
1
View file @
f92240a8
QT
+=
quick
QT
+=
quick
opengl
CONFIG
+=
c
++
11
#
The
following
define
makes
your
compiler
emit
warnings
if
you
use
...
...
This diff is collapsed.
Click to expand it.
Heavy_QML_example.pro.user
+
1
−
1
View file @
f92240a8
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.8.0, 2018-12-1
2
T1
6:24:04
. -->
<!-- Written by QtCreator 4.8.0, 2018-12-1
3
T1
0:03:53
. -->
<qtcreator>
<data>
<variable>
EnvironmentId
</variable>
...
...
This diff is collapsed.
Click to expand it.
benchmark.cpp
+
20
−
4
View file @
f92240a8
...
...
@@ -7,7 +7,6 @@
#include
<QQuickWindow>
#include
<QGuiApplication>
void
Benchmark
::
startTimer
(){
}
...
...
@@ -21,15 +20,32 @@ void Benchmark::countFrame(){
printf
(
"frame."
);
//No need to handle this. We probably just rendered extra frames before finished() completed.
}
printf
(
"frame %d: %d ms
\n
"
,
frame
,
thisframe
)
;
qDebug
()
<<
"frame "
<<
frame
<<
": "
<<
thisframe
<<
" ms"
;
frame
+=
1
;
if
(
frame
>=
maxframes
){
this
->
finished
();
}
}
void
Benchmark
::
measureFrame
(
qint64
value
){
printf
(
"%d,"
,
static_cast
<
int
>
(
value
));
void
Benchmark
::
measureMem
(){
#ifdef _WIN32
//define something for Windows (32-bit and 64-bit, this part is common)
#elif __APPLE__
#include
"TargetConditionals.h"
#if TARGET_IPHONE_SIMULATOR
// iOS Simulator
#elif TARGET_OS_IPHONE
// iOS device
#elif TARGET_OS_MAC
// Other kinds of Mac OS
#else
# error "Unknown Apple platform"
#endif
#elif __linux__
// linux
#else
# error "Unknown compiler"
#endif
}
void
Benchmark
::
finished
(){
...
...
This diff is collapsed.
Click to expand it.
benchmark.h
+
4
−
3
View file @
f92240a8
...
...
@@ -4,6 +4,7 @@
#include
<QObject>
#include
<QGuiApplication>
#include
<QElapsedTimer>
#include
<QCoreApplication>
class
Benchmark
:
public
QObject
{
...
...
@@ -18,12 +19,12 @@ class Benchmark: public QObject{
QElapsedTimer
timer
;
int
frame
=
0
;
int
lastframetotal
;
static
const
int
maxframes
=
12
0
;
static
const
int
maxframes
=
30
0
;
int
frametimes
[
maxframes
];
void
finished
();
void
startTimer
();
void
measure
Frame
(
qint64
);
void
measure
Mem
(
);
const
int
processID
=
static_cast
<
int
>
(
QCoreApplication
::
applicationPid
());
};
...
...
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