Main Content

bench

MATLAB benchmark

Description

t = bench measures the execution time of five different benchmarking tasks on your computer and compares the results to several benchmark computers. The function:

  • Returns a 1-by-5 vector with the measured execution times

  • Displays execution times for the benchmark computers

  • Creates a bar graph that ranks the computers based on their speed

Note

A benchmark is intended to compare the performance of one particular MATLAB® release on different computers. It does not offer direct comparisons between different MATLAB releases because tasks and problem sizes can change from release to release.

example

t = bench(N) runs each of the five tasks N times and returns an N-by-5 array with the execution times. If N is zero, the function does not run any of the tasks on your computer but instead displays the execution times for other computers and compares their speeds.

Fluctuations of 5–10% in the measured times of repeated runs on a single computer are typical.

Examples

collapse all

Measure the execution time of the five benchmarking tasks on your computer and compare the results to other benchmark computers.

t = bench

Figure MATLAB Benchmark contains an axes object. The axes object with title Relative Speed contains 2 objects of type bar.

Figure MATLAB Benchmark (times in seconds) contains objects of type uicontrol.

t = 1×5

    0.3552    0.2182    0.2089    2.1751    1.7931

Input Arguments

collapse all

Number of times to run the five tasks, specified as a nonnegative integer.

Output Arguments

collapse all

Measured execution times, returned as an N-by-5 vector, where N is the number of times the benchmarking tasks ran. The measured values are expressed in seconds.

More About

collapse all

Version History

Introduced in R2008a

expand all

See Also

| | | |