コードの実行に要した時間を測定するクラスです。 [詳解]
#include <OnlineCore/src/Platform/Core/ProfilingUnit.h>
クラス | |
class | Scope |
ProfilingUnitに測定情報を書き込むためのクラスです。 [詳解] | |
公開メンバ関数 | |
qUnsignedInt32 | GetAmount (void) const |
(IncAmount() で加算した)何らかの量を取得します。 [詳解] | |
qDouble | GetAvgTime () const |
実行に要した平均時間を得ます。 | |
qUnsignedInt32 | GetID () const |
ProfilingUnitオブジェクトのIDを取得します。 | |
HighResolutionTime | GetLastTime () const |
最新の所要時間を得ます。 | |
HighResolutionTime | GetMaxTime () const |
実行に要した最大時間を得ます。 | |
HighResolutionTime | GetMinTime () const |
実行に要した最小時間を得ます。 | |
const qChar * | GetName () const |
ProfilingUnitオブジェクトに設定した名前を取得します。 | |
qUnsignedInt32 | GetNbOccurences () const |
実行回数を得ます。 | |
qInt32 | GetOrder (void) const |
ProfilingUnitのソートに用いる変数を取得します。 [詳解] | |
HighResolutionTime | GetTotalTime () const |
実行に要した総合時間を得ます。 | |
qDouble | GetVarTime () const |
分散を得ます。 | |
void | IncAmount (qUnsignedInt32 amount) |
(アプリケーションにとって興味のある)何らかの量を加算します。(例:送受信バッファのサイズ等) [詳解] | |
void | SetName (const qChar *szName) |
ProfilingUnitオブジェクトに名前を設定します。 | |
void | SetOrder (qInt32 order) |
ProfilingUnitのソートに用いる変数を設定します。 [詳解] | |
静的公開メンバ関数 | |
static void | Disable (void) |
プロファイリングを無効にします。 | |
static void | Enable (void) |
プロファイリングを有効にします。 | |
static const qList< ProfilingUnit * > | FindByName (const String &name) |
Finds all ProfilingUnit with name name in the list. [詳解] | |
static bool | IsEnabled (void) |
プロファイリングが有効かどうかを返します。 [詳解] | |
コードの実行に要した時間を測定するクラスです。
特定のコードブロックの実行に要した総合時間、平均時間、最大時間、最小時間などを得ることができます。 例えば関数foo()の実行時間を測定したい場合は、関数foo()の前後に以下のようなコードを追加します。
このコードを何度か実行した後で、s_puに対してGetTotalTime() などのメンバ関数を呼び出すと、 s_puインスタンスに記録された測定情報を取得できます。
void nn::nex::ProfilingUnit::IncAmount | ( | qUnsignedInt32 | amount | ) |
qUnsignedInt32 nn::nex::ProfilingUnit::GetAmount | ( | void | ) | const |
void nn::nex::ProfilingUnit::SetOrder | ( | qInt32 | order | ) |
ProfilingUnitのソートに用いる変数を設定します。
[in] | order | ソート番号。 |
qInt32 nn::nex::ProfilingUnit::GetOrder | ( | void | ) | const |
ProfilingUnitのソートに用いる変数を取得します。
|
static |
プロファイリングが有効かどうかを返します。
|
static |
Finds all ProfilingUnit with name name in the list.
[in] | name | The ProfilingUnit name. |