Package | Description |
---|---|
cn.hutool.core.thread |
提供线程及高并发封装,入口为ThreadUtil
|
Modifier and Type | Method and Description |
---|---|
static ConcurrencyTester |
ThreadUtil.concurrencyTest(int threadSize,
Runnable runnable)
并发测试
此方法用于测试多线程下执行某些逻辑的并发性能 调用此方法会导致当前线程阻塞。 |
ConcurrencyTester |
ConcurrencyTester.reset()
重置测试器,重置包括:
清空worker
重置计时器
|
ConcurrencyTester |
ConcurrencyTester.test(Runnable runnable)
执行测试
执行测试后不会关闭线程池,可以调用 close() 释放线程池 |
Copyright © 2024. All rights reserved.