/
Igor_Lakienko
/
profiler
Обзор
Документация
Войти
/
Igor_Lakienko
/
profiler
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Bench.java
8 строк
398 B
Igor Lakienko
init
04 авг 2026, 14:53
04 авг 2026, 14:53
4b159ae
Код
Авторство
О чём код?
public class Bench { static long hot(long n) { long s = 0; for (long i = 0; i < n; i++) s += i % 7; return s; } static void cold() { try { Thread.sleep(1); } catch (Exception ignored) {} } public static void main(String[] a) throws Exception { long end = System.currentTimeMillis() + 30000; while (System.currentTimeMillis() < end) { hot(20_000_000L); cold(); } } }