mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Add Test.profileRange
This commit is contained in:
parent
e181c2a16e
commit
9d4fdfa38a
2 changed files with 9 additions and 0 deletions
interface/src/scripting
|
@ -134,3 +134,9 @@ void TestScriptingInterface::startTraceEvent(QString name) {
|
|||
void TestScriptingInterface::endTraceEvent(QString name) {
|
||||
tracing::traceEvent(trace_test(), name, tracing::DurationEnd);
|
||||
}
|
||||
|
||||
void TestScriptingInterface::profileRange(const QString& name, QScriptValue fn) {
|
||||
PROFILE_RANGE(script, name);
|
||||
fn.call();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include <functional>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
class QScriptValue;
|
||||
|
||||
class TestScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -69,6 +71,7 @@ public slots:
|
|||
|
||||
void endTraceEvent(QString name);
|
||||
|
||||
Q_INVOKABLE void profileRange(const QString& name, QScriptValue function);
|
||||
|
||||
private:
|
||||
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
||||
|
|
Loading…
Reference in a new issue