CTR NEX API Reference
nn::nex::ProfilingUnit クラス

コードの実行に要した時間を測定するクラスです。 [詳解]

#include <OnlineCore/src/Platform/Core/ProfilingUnit.h>

+ nn::nex::ProfilingUnit の継承関係図

クラス

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 qCharGetName () 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()の前後に以下のようなコードを追加します。

{

    static NAMESPACE_NEX ProfilingUnit s_pu(NEX_T("foo_func"));

    NAMESPACE_NEX ProfilingUnit::Scope scoped(s_pu);

    foo();

}

このコードを何度か実行した後で、s_puに対してGetTotalTime() などのメンバ関数を呼び出すと、 s_puインスタンスに記録された測定情報を取得できます。

関数詳解

void nn::nex::ProfilingUnit::IncAmount ( qUnsignedInt32  amount)

(アプリケーションにとって興味のある)何らかの量を加算します。(例:送受信バッファのサイズ等)

引数
[in]amount加算対象。
参照
GetAmount
qUnsignedInt32 nn::nex::ProfilingUnit::GetAmount ( void  ) const

IncAmount() で加算した)何らかの量を取得します。

参照
IncAmount
戻り値
加算対象の和。
void nn::nex::ProfilingUnit::SetOrder ( qInt32  order)

ProfilingUnitのソートに用いる変数を設定します。

引数
[in]orderソート番号。
qInt32 nn::nex::ProfilingUnit::GetOrder ( void  ) const

ProfilingUnitのソートに用いる変数を取得します。

戻り値
ソート番号。
static bool nn::nex::ProfilingUnit::IsEnabled ( void  )
static

プロファイリングが有効かどうかを返します。

戻り値
プロファイリングが有効であればtrue、そうでなければfalseが返ります。
static const qList<ProfilingUnit*> nn::nex::ProfilingUnit::FindByName ( const String name)
static

Finds all ProfilingUnit with name name in the list.

引数
[in]nameThe ProfilingUnit name.
戻り値
A list of ProfilingUnits with name name.
覚え書き
This is not meant to be efficient, and will iterate across the entire list of ProfilingUnits.