target.Timer クラス
名前空間: target
プロセッサのタイマーの詳細を提供する
説明
target.Timer クラスを使用して、プロセッサのタイマーの詳細を提供します。たとえば、C または C++ 関数のインターフェイスと実装、周波数、タイマーのカウント方向に関する情報などです。プロファイリング用に C または C++ コードのインストルメント化に関する情報を提供するために、タイマーの詳細を target.Processor オブジェクトと関連付けることができます。
target.Timer オブジェクトの作成には関数 target.create を使用します。オブジェクトを作成してから、別のステップを使用してプロパティを指定します。または、名前と値の引数を使用して、オブジェクトの作成とプロパティの指定を単一のステップで行います。
プロパティ
タイマーの名前。
属性:
GetAccess | public |
SetAccess | public |
タイマーのカウント方向。
属性:
GetAccess | public |
SetAccess | public |
API 実装に関する情報。現在の時間を判断するために使用されます。
名前と値の引数を使用して target.Timer オブジェクトを作成する場合、APIImplementation プロパティに対し、以下の引数を指定します。
| 名前 | 説明 |
|---|---|
'FunctionName' | 必須。target.Function オブジェクトの Name プロパティ。 |
'FunctionReturnType' | 必須。target.Function オブジェクトの ReturnType プロパティ。 |
'IncludeFiles' | 必須。target.BuildDependencies オブジェクトの IncludeFiles プロパティ。 |
'FunctionLanguage' | オプション。target.API オブジェクトの Language プロパティ。 |
'SourceFiles' | オプション。target.BuildDependencies オブジェクトの SourceFiles プロパティ。 |
'IncludePaths' | オプション。target.BuildDependencies オブジェクトの IncludePaths プロパティ。 |
属性:
GetAccess | public |
SetAccess | public |
タイマー関数によって返される単位の周波数。この値は、タイマー関数の出力を秒単位に変換するために使用できます。ヘルパー クラス target.unit.Frequency には、いくつかの共通する周波数単位が含まれます。
属性:
GetAccess | public |
SetAccess | public |
データ型: uint64
例
開発用コンピューター向けの timer オブジェクトを作成します。
タイマーの関数シグネチャを作成します。この例では、関数は uint64 データ型と関数名 timestamp_x86 を返します。
timerSignature = target.create('Function'); timerSignature.Name = 'timestamp_x86'; timerSignature.ReturnType = 'uint64';
API オブジェクト内の関数を取得します。
timerApi = target.create('API'); timerApi.Functions = timerSignature; timerApi.Language = target.Language.C; timerApi.Name = 'Linux Timer API';
関数の依存関係、つまり関数を実行するために必要なソース ファイルとヘッダー ファイルを取得します。
timerDependencies = target.create('BuildDependencies'); timerDependencies.IncludeFiles = {'host_timer_x86.h'}; timerDependencies.IncludePaths = ... {'$(MATLAB_ROOT)/toolbox/coder/profile/src'}; timerDependencies.SourceFiles = {'host_timer_x86.c'};
API と依存関係を組み合わせるオブジェクトを作成します。
timerImplementation = target.create('APIImplementation'); timerImplementation.API = timerApi; timerImplementation.BuildDependencies = timerDependencies; timerImplementation.Name = 'Linux Timer Implementation';
timer オブジェクトを作成してタイマー情報に関連付けます。
timer = target.create('Timer'); timer.APIImplementation = timerImplementation; timer.Name = 'Linux Timer';
メモ
名前と値の引数を使用して、次のコマンドで timer オブジェクトを作成できます。
timer = target.create('Timer', 'Name', 'Linux Timer', ... 'FunctionName', 'timestamp_x86', ... 'FunctionReturnType', 'uint64', ... 'FunctionLanguage', target.Language.C, ... 'SourceFiles', {'host_timer_x86.c'}, ... 'IncludeFiles', {'host_timer_x86.h'}, ... 'IncludePaths', {'$(MATLAB_ROOT)/toolbox/coder/profile/src'})
タイマーとアドオンを processor オブジェクトに割り当てます。
processor = target.get('Processor', 'Intel-x86-64 (Linux 64)'); processor.Timers = timer;
既存の timer オブジェクトをコピーして、そのコピーの特定のプロパティ値を変更することにより、新しい timer オブジェクトを作成できます。
newTimer = target.create('Timer', ... 'Copy', 'Linux Timer', ... 'Name', 'NewTimerName', ... 'FunctionName', 'newFunctioName');
バージョン履歴
R2020b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)