runtimeTime.setVariables() execution time is long

Camunda’s API: runtimeTime.setVariables() execution time is long, I found it by chance, usually about 2s, occasionally with 10s, anyone know why?