Skip to main content

BENCHMARK

Syntax

BENCHMARK(count,expr)

Description

The BENCHMARK() function executes the scalar expression expr count times and returns 0. If the arguments are invalid, such as NULL values or a negative count, it returns NULL.

expr must be a scalar expression. BENCHMARK() can be used to measure the performance of scalar expressions. The reported time is the client-side execution time, not the server-side CPU time.

Examples

SELECT BENCHMARK(100,AES_ENCRYPT('hello','world'));
+---------------------------------------------+
| BENCHMARK(100,AES_ENCRYPT('hello','world')) |
+---------------------------------------------+
| 0 |
+---------------------------------------------+
1 row in set (0.001 sec)