public abstract class TestUtils extends Object
| Constructor and Description |
|---|
TestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static long |
getCost(long startNanoTime)
获取耗时,单位:毫秒
|
static long |
getStartTime()
获取测试起始纳秒时间
|
static long[] |
performanceTest(int threadCount,
int times,
Function<TestParam,?>... functions)
函数性能测试
|
static long[] |
performanceTest(int threadCount,
int times,
Supplier<?>... suppliers) |
@NonNull
public static long[] performanceTest(int threadCount,
int times,
Function<TestParam,?>... functions)
threadCount - 并行执行的线程数times - 每个线程运行次数functions - 需比较性能的函数集,每个函数可以设置一个返回值,表示函数别名,会打印在控制台中@NonNull
public static long[] performanceTest(int threadCount,
int times,
Supplier<?>... suppliers)
public static long getStartTime()
public static long getCost(long startNanoTime)
startNanoTime - 起始纳秒数Copyright © 2021–2022 EasyJ开源社区. All rights reserved.