#include <MicroBenchmarkSubsystem.h>
Inherits UGameInstanceSubsystem.
|
void | ResetAll () |
| reset all currently logged benchmark timings.
|
|
void | Tic (const FName BenchmarkName="MyBenchmark", const bool bReset=false) |
| Start a benchmark. usage. tic -> code to benchmark -> toc. More...
|
|
int64 | Toc (const FName BenchmarkName="MyBenchmark", const bool bShowLog=false) |
| stop a benchmark. usage. tic -> code to benchmark -> toc More...
|
|
void | PrintMicroBenchmarkResults (const FName BenchmarkName=NAME_None) |
| Print the results of all/any micro benchmarks running this session. More...
|
|
int64 | GetBenchmarkResultAverage (FName BenchmarkName="MyBenchmark") |
| Retrieve the average execution time of the specified benchmark. More...
|
|
|
static FString | BeautifyDuration (std::chrono::nanoseconds input_ns) |
| convert the supplied nanosecond amount to human-readable string
|
|
|
TMap< FName, std::chrono::nanoseconds > | OpenBenchmarks |
| all benchmarks from the since last reset call
|
|
TMap< FName, FBenchResult > | BenchmarkResults |
| all timed benchmark results since the last reset call
|
|
std::chrono::nanoseconds | Overhead = std::chrono::nanoseconds(0) |
| Approximate overhead of calling tic and toc.
|
|
Subsystem for Micro Benchmarks
Easy to use micro benchmarking timer tool. Get accurate timings for any code blocks in Blueprints or C++. Simply call "tic" right before the code block you want to time and call "toc" directly after. Either print the results immediately (setting "bShowLog" in "toc" to "true") or periodically print micro benchmark results.
◆ GetBenchmarkResultAverage()
int64 UMicroBenchmarkSubsystem::GetBenchmarkResultAverage |
( |
FName |
BenchmarkName = "MyBenchmark" | ) |
|
Retrieve the average execution time of the specified benchmark.
- Parameters
-
BenchmarkName | benchmark name to retrieve. |
- Returns
- Time in nanoseconds or -1 if not exists.
◆ PrintMicroBenchmarkResults()
void UMicroBenchmarkSubsystem::PrintMicroBenchmarkResults |
( |
const FName |
BenchmarkName = NAME_None | ) |
|
Print the results of all/any micro benchmarks running this session.
- Parameters
-
BenchmarkName | benchmark name, defaults to None to print all running benchmarks |
◆ Tic()
void UMicroBenchmarkSubsystem::Tic |
( |
const FName |
BenchmarkName = "MyBenchmark" , |
|
|
const bool |
bReset = false |
|
) |
| |
Start a benchmark. usage. tic -> code to benchmark -> toc.
- Parameters
-
BenchmarkName | benchmark name. if a benchmark with the supplied name is already runnign it will get reset. |
bReset | reset any averaged benchmark results for this benchmark name |
◆ Toc()
int64 UMicroBenchmarkSubsystem::Toc |
( |
const FName |
BenchmarkName = "MyBenchmark" , |
|
|
const bool |
bShowLog = false |
|
) |
| |
stop a benchmark. usage. tic -> code to benchmark -> toc
- Parameters
-
BenchmarkName | benchmark name |
bShowLog | directly show output of tic -> toc time. not recommending for short benchmarks (e.g. within your Tick functions) |
- Returns
- nanoseconds of benchmark
The documentation for this class was generated from the following files: