coder.performance.TimingResult
Description
Use a coder.performance.TimingResult
object to get detailed
information about the execution times of the generated code.
To create a coder.performance.TimingResult
object, use the coder.timeit
function.
Properties
Name
— Name of generated function
character vector
Name of the generated function, specified as a character vector.
Runtimes
— List of all execution times
double
array
List of all the individual execution times after the warmup phase, specified as
double
array.
The warmup phase is a period to stabilize a system before measuring the execution time.
FirstRuntime
— First execution times
double
First execution times obtained before warmup phase, specified as
double
.
MinRuntime
— Minimum of Runtimes
double
Minimum execution time from Runtimes
obtained during timing,
specified as double
.
Examples
Find Information About Execution Time of Generated Code
Find information about the execution time of generated code by creating a coder.performance.TimingResult
object and displaying its properties.
Define the MATLAB® function integralExpLn
.
function out = integralExpLn(xmin,xmax) f = @(x) exp(-x.^2).*log(x).^2; out = integral(f,xmin,xmax); end
Use the coder.timeit
function to create a coder.performance.TimingResult
object.
[~,trObj] = coder.timeit("integralExpLn",1,{0 Inf});
coder_timeit INFO: Generating code and building MEX. coder_timeit INFO: Running MEX. TimingResult with 40372 Runtime Sample(s) Statistical Overview: mean = 1.24e-05 s max = 5.63e-04 s sd = 4.44e-06 s median = 1.20e-05 s min = 1.15e-05 s 90th = 1.31e-05 s
Use the properties of the coder.performance.TimingResult
object to find information about the execution time of the generated code.
trObj.Name
ans = 'integralExpLn_mex'
trObj.Runtimes(1:5)
ans = 1×5
10-4 ×
0.1720 0.1410 0.1400 0.1500 0.1340
tIQR = iqr(trObj.Runtimes)
tIQR = 9.0000e-07
trObj.FirstRuntime
ans = 7.4400e-05
trObj.MinRuntime
ans = 1.1500e-05
Version History
Introduced in R2024b
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)