ID EN
Information Functions

BENCHMARK(count,expr)

MySQL 8.4 🇮🇩 Bahasa Indonesia

Fungsi BENCHMARK() mengeksekusi ekspresi expr berulang kali, menghitung waktu. Ini mungkin digunakan untuk mengukur seberapa cepat MySQL memproses ekspresi. Nilai hasilnya adalah 0, atau NULL untuk argumen yang tidak sesuai seperti NULL atau jumlah pengulangan negatif.

Syntax

MYSQL
SELECT BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye'));
+---------------------------------------------------+
| BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye')) |
+---------------------------------------------------+
|                                                 0 |
+---------------------------------------------------+
1 row in set (4.74 sec)

Contoh

Example

The intended use is from within the mysql client, which reports query execution times:

MYSQL
SELECT BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye'));
+---------------------------------------------------+
| BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye')) |
+---------------------------------------------------+
|                                                 0 |
+---------------------------------------------------+
1 row in set (4.74 sec)