diff options
author | Armin Berres <armin.berres@basyskom.de> | 2010-04-13 15:44:34 +0200 |
---|---|---|
committer | Sergiy Dubovik <sergiy.dubovik@nokia.com> | 2010-04-15 10:25:25 +0300 |
commit | 74cbd6bb21daab9baf20b39a8e9baeae7ae6e281 (patch) | |
tree | 8e9698b6c87cde1ef97222050c69389eb4066200 /mthemedaemon | |
parent | cf30d578e2158dbfaf8200adb48c8ea0507aec36 (diff) |
New: an application which measures how long themedaemon needs to answer
RevBy: TrustMe
Details: A given list of pixmap ids and respective sizes is requested
from the remote and the local themedaemon. The time until the pixmap
is available is measured.
Diffstat (limited to 'mthemedaemon')
-rw-r--r-- | mthemedaemon/benchmark/benchmark.pro | 55 | ||||
-rw-r--r-- | mthemedaemon/benchmark/benchmarklocalclient.cpp | 33 | ||||
-rw-r--r-- | mthemedaemon/benchmark/benchmarklocalclient.h | 19 | ||||
-rw-r--r-- | mthemedaemon/benchmark/benchmarkremoteclient.cpp | 183 | ||||
-rw-r--r-- | mthemedaemon/benchmark/benchmarkremoteclient.h | 82 | ||||
-rw-r--r-- | mthemedaemon/benchmark/common.cpp | 112 | ||||
-rw-r--r-- | mthemedaemon/benchmark/common.h | 31 | ||||
-rw-r--r-- | mthemedaemon/benchmark/main.cpp | 39 |
8 files changed, 554 insertions, 0 deletions
diff --git a/mthemedaemon/benchmark/benchmark.pro b/mthemedaemon/benchmark/benchmark.pro new file mode 100644 index 00000000..7150ee54 --- /dev/null +++ b/mthemedaemon/benchmark/benchmark.pro @@ -0,0 +1,55 @@ +# hardcoded to avoid dependency on files created by configure +DEFINES += THEMEDIR=\\\"\"/usr/share/themes\"\\\" + +INCLUDEPATH += . \ + ../ \ + ../../src/include \ + ../../src \ + ../../src/corelib \ + ../../src/corelib/core \ + ../../src/corelib/theme + +DEPENDPATH += $$INCLUDEPATH +QMAKE_LIBDIR += ../lib +TEMPLATE = app +DEPENDPATH += . +QT += svg \ + network + +#DEFINES += PRINT_INFO_MESSAGES + +# Check for mixing of const and non-const iterators, +# which can cause problems when built with some compilers: +DEFINES += QT_STRICT_ITERATORS +!win32:CONFIG += link_pkgconfig +PKGCONFIG += gconf-2.0 + +# Input +SOURCES += benchmarkremoteclient.cpp \ + ../../src/corelib/theme/mthemedaemon.cpp \ + ../../src/corelib/theme/mcommonpixmaps.cpp \ + ../../src/corelib/theme/mimagedirectory.cpp \ + ../../src/corelib/theme/mthemedaemonclient.cpp \ + ../../src/corelib/theme/mthemedaemonprotocol.cpp \ + ../../src/corelib/theme/mthemeresourcemanager.cpp \ + ../../src/corelib/core/mgconfitem.cpp \ + ../../src/corelib/core/mcpumonitor.cpp \ + main.cpp \ + benchmarklocalclient.cpp \ + common.cpp \ + ../../src/corelib/theme/mlocalthemedaemon.cpp + +HEADERS += benchmarkremoteclient.h \ + ../../src/corelib/theme/imthemedaemon.h \ + ../../src/corelib/theme/mthemedaemon.h \ + ../../src/corelib/theme/mcommonpixmaps.h \ + ../../src/corelib/theme/mimagedirectory.h \ + ../../src/corelib/theme/mthemedaemonclient.h \ + ../../src/corelib/theme/mthemedaemonprotocol.h \ + ../../src/corelib/theme/mthemeresourcemanager.h \ + ../../src/corelib/core/mgconfitem.h \ + ../../src/corelib/core/mcpumonitor.h \ + benchmarklocalclient.h \ + common.h \ + ../../src/corelib/theme/mthemedaemon.h \ + ../../src/corelib/theme/mlocalthemedaemon.h diff --git a/mthemedaemon/benchmark/benchmarklocalclient.cpp b/mthemedaemon/benchmark/benchmarklocalclient.cpp new file mode 100644 index 00000000..181b1c53 --- /dev/null +++ b/mthemedaemon/benchmark/benchmarklocalclient.cpp @@ -0,0 +1,33 @@ +#include <QApplication> + +#include "mlocalthemedaemon.h" + +#include "benchmarklocalclient.h" +#include "common.h" + +BenchmarkLocalClient::BenchmarkLocalClient() +{ +} + +void BenchmarkLocalClient::run() { + MLocalThemeDaemon themeDaemon(qApp->applicationName()); + + QList<QPair<QString,QSize> > pixmapsToRequest = Common::getPixmapsToRequest(); + + QMap<QString, RequestInfo> answeredRequests; + QListIterator<QPair<QString,QSize> > iter(pixmapsToRequest); + while (iter.hasNext()) { + QPair<QString,QSize> request = iter.next(); + + RequestInfo info; + info.request = QTime::currentTime(); + themeDaemon.pixmapHandleSync(request.first, request.second); + info.answer = QTime::currentTime(); + themeDaemon.releasePixmap(request.first, request.second); + answeredRequests[request.first] = info; + } + + Common::printResults("local theme daemon", answeredRequests, QMap<QString, RequestInfo>()); + + emit finished(); +} diff --git a/mthemedaemon/benchmark/benchmarklocalclient.h b/mthemedaemon/benchmark/benchmarklocalclient.h new file mode 100644 index 00000000..ae5b7422 --- /dev/null +++ b/mthemedaemon/benchmark/benchmarklocalclient.h @@ -0,0 +1,19 @@ +#ifndef BENCHMARKLOCALCLIENT_H +#define BENCHMARKLOCALCLIENT_H + +#include <QObject> + +class BenchmarkLocalClient : public QObject +{ + Q_OBJECT +public: + BenchmarkLocalClient(); + +signals: + void finished(); + +public slots: + void run(); +}; + +#endif // BENCHMARKLOCALCLIENT_H diff --git a/mthemedaemon/benchmark/benchmarkremoteclient.cpp b/mthemedaemon/benchmark/benchmarkremoteclient.cpp new file mode 100644 index 00000000..a9c56c25 --- /dev/null +++ b/mthemedaemon/benchmark/benchmarkremoteclient.cpp @@ -0,0 +1,183 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libm. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#include <stdlib.h> +#include <QTimer> +#include <QDebug> +#include <QPainter> +#include <QImage> +#include <MGConfItem> +#include <QApplication> +#include <QTextStream> + +#include "mthemedaemon.h" +#include "mthemedaemonprotocol.h" + +#include "benchmarkremoteclient.h" +#include "common.h" + +using namespace M::MThemeDaemonProtocol; + + +BenchmarkRemoteClient::BenchmarkRemoteClient() : packetsSent(0) +{ + stream.setDevice(&socket); + + connect(&socket, SIGNAL(connected()), SLOT(connected())); + connect(&socket, SIGNAL(disconnected()), SLOT(disconnected())); + connect(&socket, SIGNAL(readyRead()), this, SLOT(readyRead())); + + connect(this, SIGNAL(pixmapReady(quint32,M::MThemeDaemonProtocol::PixmapIdentifier)), this, SLOT(updatePixmapStats(quint32,M::MThemeDaemonProtocol::PixmapIdentifier))); +} + +BenchmarkRemoteClient::~BenchmarkRemoteClient() +{ + if (socket.state() == QLocalSocket::ConnectedState) { + socket.disconnectFromServer(); + } +} + +void BenchmarkRemoteClient::run() { + // connect to server + socket.connectToServer(M::MThemeDaemonProtocol::ServerAddress); + + if (!socket.waitForConnected(5000)) { + qWarning() << "ERROR: failed to connect server:" << socket.error(); + emit finished(); + return; + } + +#ifdef PRINT_INFO_MESSAGES + qDebug() << "Connected to themedaemon socket"; +#endif + + pixmapsToRequest = Common::getPixmapsToRequest(); + + registerToServer(); +} + +void BenchmarkRemoteClient::connected() +{ +// QLocalSocket* socket = qobject_cast<QLocalSocket*>(sender()); +} + +void BenchmarkRemoteClient::disconnected() +{ +// QLocalSocket* socket = qobject_cast<QLocalSocket*>(sender()); +} + +void BenchmarkRemoteClient::registerToServer() +{ +#ifdef PRINT_INFO_MESSAGES + qDebug() << "INFO: registering to server"; +#endif + Packet registration(Packet::RequestRegistrationPacket, packetsSent++); + registration.setData(new String("benchmark-client")); + stream << registration; + + sendPacket(); +} + +M::MThemeDaemonProtocol::Packet BenchmarkRemoteClient::processOnePacket() +{ + Packet packet; + stream >> packet; + + switch (packet.type()) { + case Packet::PixmapUpdatedPacket: { + const PixmapHandle *handle = static_cast<const PixmapHandle *>(packet.data()); + + if(handle->pixmapHandle) { + emit pixmapReady(handle->pixmapHandle, handle->identifier); + } else { + qWarning() << "ERROR: daemon returned null handle for" << handle->identifier.imageId; + } + } break; + + case Packet::ThemeChangedPacket: + break; + case Packet::ThemeDaemonStatusPacket: + break; + default: + break; + } + + return packet; +} + +void BenchmarkRemoteClient::updatePixmapStats(quint32 handle, const M::MThemeDaemonProtocol::PixmapIdentifier& identifier) +{ + QMap<QString, RequestInfo>::iterator requestInfo = requestedPixmaps.find(identifier.imageId); + Q_ASSERT(requestInfo != requestedPixmaps.end()); + requestedPixmaps.erase(requestInfo); + + requestInfo->answer = QTime::currentTime(); + requestInfo->size = identifier.size; + readyPixmaps[identifier.imageId] = *requestInfo; + releasePixmap(identifier); +} + +void BenchmarkRemoteClient::readyRead() +{ + while (socket.bytesAvailable() > 0) { + processOnePacket(); + } +} + +void BenchmarkRemoteClient::sendPacket() +{ + if (pixmapsToRequest.count() > 0) { + QPair<QString,QSize> toRequest = pixmapsToRequest.takeLast(); + PixmapIdentifier pixmapIdentifier(toRequest.first, toRequest.second); + requestPixmap(pixmapIdentifier); + QTimer::singleShot(50, this, SLOT(sendPacket())); + } else { + QTimer::singleShot(5000, this, SLOT(printResults())); + } +} + +void BenchmarkRemoteClient::requestPixmap(M::MThemeDaemonProtocol::PixmapIdentifier &pixmapIdentifier) +{ +#ifdef PRINT_INFO_MESSAGES + qDebug() << "INFO: requesting pixmap" << pixmapIdentifier.imageId << pixmapIdentifier.size; +#endif + Packet packet(Packet::RequestPixmapPacket, packetsSent++); + packet.setData(new PixmapIdentifier(pixmapIdentifier)); + stream << packet; + + RequestInfo requestInfo; + requestInfo.request = QTime::currentTime(); + requestedPixmaps.insert(pixmapIdentifier.imageId, requestInfo); +} + +void BenchmarkRemoteClient::releasePixmap(const M::MThemeDaemonProtocol::PixmapIdentifier &pixmapIdentifier) +{ +#ifdef PRINT_INFO_MESSAGES + qDebug() << "INFO: releasing pixmap" << pixmapIdentifier.imageId << pixmapIdentifier.size; +#endif + Packet packet(Packet::ReleasePixmapPacket, packetsSent++); + packet.setData(new PixmapIdentifier(pixmapIdentifier)); + stream << packet; + requestedPixmaps.remove(pixmapIdentifier.imageId); +} + +void BenchmarkRemoteClient::printResults() { + Common::printResults("remote theme daemon", readyPixmaps, requestedPixmaps); + emit finished(); +} diff --git a/mthemedaemon/benchmark/benchmarkremoteclient.h b/mthemedaemon/benchmark/benchmarkremoteclient.h new file mode 100644 index 00000000..7f0e19c0 --- /dev/null +++ b/mthemedaemon/benchmark/benchmarkremoteclient.h @@ -0,0 +1,82 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libm. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#ifndef CLIENT_H +#define CLIENT_H + +#include <QThread> +#include <QDataStream> +#include <QSize> +#include <QDir> +#include <QLocalSocket> +#include <QMutex> +#include <QWaitCondition> +#include <QSemaphore> +#include <QMap> +#include <QTime> + +#include "mthemedaemonclient.h" + +#include "common.h" + + +class BenchmarkRemoteClient : public QObject +{ + Q_OBJECT + +public: + BenchmarkRemoteClient(); + ~BenchmarkRemoteClient(); + +signals: + void pixmapReady(quint32 handle, const M::MThemeDaemonProtocol::PixmapIdentifier& identifier); + void finished(); + +public slots: + void run(); + +protected: + void requestPixmap(M::MThemeDaemonProtocol::PixmapIdentifier &); + void releasePixmap(const M::MThemeDaemonProtocol::PixmapIdentifier &); + + M::MThemeDaemonProtocol::Packet processOnePacket(); + +private slots: + void connected(); + void disconnected(); + void registerToServer(); + void sendPacket(); + void updatePixmapStats(quint32 handle, const M::MThemeDaemonProtocol::PixmapIdentifier& identifier); + void readyRead(); + void printResults(); + +private: + + bool isDataConsistent(const M::MThemeDaemonProtocol::ClientList *reply); + void quit(); + + QLocalSocket socket; + QDataStream stream; + QList<QPair<QString,QSize> > pixmapsToRequest; + QMap<QString, RequestInfo> requestedPixmaps; + QMap<QString, RequestInfo> readyPixmaps; + quint64 packetsSent; +}; + +#endif diff --git a/mthemedaemon/benchmark/common.cpp b/mthemedaemon/benchmark/common.cpp new file mode 100644 index 00000000..9b0caf7e --- /dev/null +++ b/mthemedaemon/benchmark/common.cpp @@ -0,0 +1,112 @@ +#include <QApplication> +#include <QList> +#include <QPair> +#include <QSize> +#include <QString> + +#include "common.h" + +QList<QPair<QString,QSize> > Common::getPixmapsToRequest() { + // list of ids requested when browsing around in widgetsgallery + QList<QPair<QString,QSize> > pixmapsToRequest; + pixmapsToRequest << QPair<QString,QSize>("icon-m-list", QSize(30, 30)) + << QPair<QString,QSize>("icon-m-grid", QSize(30, 30)) + << QPair<QString,QSize>("Icon-pictures", QSize(0, 0)) + << QPair<QString,QSize>("Icon-video", QSize(30, 30)) + << QPair<QString,QSize>("Icon-new-SMS", QSize(30, 30)) + << QPair<QString,QSize>("Icon-contacts", QSize(30, 30)) + << QPair<QString,QSize>("duilist-singlecolumn-center-background", QSize(0, 0)) + << QPair<QString,QSize>("duislider-background-received", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlerow-center-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duinavigationbar-toolbarbutton-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-topleft-background", QSize(0, 0)) + << QPair<QString,QSize>("duiapplicationpage-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-top-background", QSize(0, 0)) + << QPair<QString,QSize>("duislider-handle-value-background", QSize(0, 0)) + << QPair<QString,QSize>("duislider-handle", QSize(64, 64)) + << QPair<QString,QSize>("icon-m-framework-home", QSize(50, 50)) + << QPair<QString,QSize>("duilist-singlecolumn-top-background", QSize(0, 0)) + << QPair<QString,QSize>("duinavigationbar-button-home-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-bottomright-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duinavigationbar-button-close-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-left-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlerow-right-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-top-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlerow-left-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duislider-vertical-background-elapsed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-right-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-topright-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-topright-background", QSize(0, 0)) + << QPair<QString,QSize>("duislider-background-elapsed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlerow-left-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-bottomleft-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-left-background", QSize(0, 0)) + << QPair<QString,QSize>("duibutton-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duicontainer-content-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-center-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-bottomleft-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duislider-vertical-background-received", QSize(0, 0)) + << QPair<QString,QSize>("duilist-topleft-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duinavigationbar-toolbar-background", QSize(0, 0)) + << QPair<QString,QSize>("icon-m-menuarrow", QSize(24, 24)) + << QPair<QString,QSize>("duilist-bottomright-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlecolumn-top-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duicontainer-header-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duicontainer-header-background", QSize(0, 0)) + << QPair<QString,QSize>("duinavigationbar-viewmenu-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duiprogressindicator-spinner-large-on", QSize(16, 16)) + << QPair<QString,QSize>("duinavigationbar-viewmenu-background", QSize(0, 0)) + << QPair<QString,QSize>("duislider-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlerow-center-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlerow-right-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlecolumn-center-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duiprogressindicator-spinner-large-off", QSize(16, 16)) + << QPair<QString,QSize>("duinavigationbar-portrait-toolbar-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-single-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duislider-vertical-background", QSize(0, 0)) + << QPair<QString,QSize>("duiseparator-horizontal-background", QSize(0, 0)) + << QPair<QString,QSize>("duitextedit-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-bottom-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-bottom-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duipositionindicator-background", QSize(6, 6)) + << QPair<QString,QSize>("icon-m-framework-back", QSize(50, 50)) + << QPair<QString,QSize>("duilist-single-background", QSize(0, 0)) + << QPair<QString,QSize>("duilist-center-background-pressed", QSize(0, 0)) + << QPair<QString,QSize>("duilist-singlecolumn-bottom-background", QSize(0, 0)) + << QPair<QString,QSize>("duislider-vertical-handle-pressed", QSize(64, 64)) + << QPair<QString,QSize>("duilist-right-background", QSize(0, 0)) + << QPair<QString,QSize>("duislider-handle-pressed", QSize(64, 64)) + << QPair<QString,QSize>("duipositionindicator-indicator", QSize(6, 6)) + << QPair<QString,QSize>("duibutton-background", QSize(0, 0)) + << QPair<QString,QSize>("icon-m-framework-close", QSize(50, 50)) + << QPair<QString,QSize>("duislider-vertical-handle", QSize(64, 64)) + << QPair<QString,QSize>("duilist-singlecolumn-bottom-background-pressed", QSize(0, 0)); + return pixmapsToRequest; +} + +void Common::printResults(const QString& serverType, QMap<QString, RequestInfo> answeredRequests, QMap<QString, RequestInfo> unansweredRequests) +{ + QTextStream log(stdout, QIODevice::WriteOnly | QIODevice::Text); + log << "###Timing results for " << serverType << "###" << '\n'; + + const int idWidth = 60; + log << left << qSetFieldWidth(idWidth) << "Pixmap Id" << qSetFieldWidth(0) << "Delay" << '\n'; + + QMapIterator<QString, RequestInfo> iter(answeredRequests); + while (iter.hasNext()) { + iter.next(); + log << qSetFieldWidth(idWidth) << iter.key() << qSetFieldWidth(0) << iter.value().delay() << "ms" << '\n'; + } + + if (!unansweredRequests.isEmpty()) { + log << '\n'; + log << "The following pixmap requests have not been answered by the themedaemon: "; + QMapIterator<QString, RequestInfo> iter(unansweredRequests); + while (iter.hasNext()) { + iter.next(); + log << iter.key() << " "; + } + } + log << '\n'; + log.flush(); +} diff --git a/mthemedaemon/benchmark/common.h b/mthemedaemon/benchmark/common.h new file mode 100644 index 00000000..4041b3c7 --- /dev/null +++ b/mthemedaemon/benchmark/common.h @@ -0,0 +1,31 @@ +#ifndef COMMON_H +#define COMMON_H + +#include <QTime> +#include <QList> +#include <QPair> +#include <QSize> +#include <QMap> +#include <QTextStream> + +class QString; +class QSize; + +struct RequestInfo { + int delay() const { + return request.msecsTo(answer); + } + + QTime request; + QTime answer; + QSize size; +}; + +class Common { +public: + static QList<QPair<QString,QSize> > getPixmapsToRequest(); + static void printResults(const QString& serverType, QMap<QString, RequestInfo> answeredRequests, QMap<QString, RequestInfo> unansweredRequests); + +}; + +#endif // COMMON_H diff --git a/mthemedaemon/benchmark/main.cpp b/mthemedaemon/benchmark/main.cpp new file mode 100644 index 00000000..2745d6c4 --- /dev/null +++ b/mthemedaemon/benchmark/main.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libm. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#include <QDebug> +#include <QApplication> +#include <QTimer> + +#include "benchmarkremoteclient.h" +#include "benchmarklocalclient.h" + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + BenchmarkRemoteClient remoteClient; + BenchmarkLocalClient localClient; + + QTimer::singleShot(0, &remoteClient, SLOT(run())); + QObject::connect(&remoteClient, SIGNAL(finished()), &localClient, SLOT(run())); + QObject::connect(&localClient, SIGNAL(finished()), qApp, SLOT(quit())); + + return app.exec(); +} |