-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
I use spring-core:5.2.9.RELEASE
.
When I invoke StopWatch#prettyPrint
,
StopWatch '': running time = 9624841500 ns
---------------------------------------------
ns % Task name
---------------------------------------------
1202450400 012% createRandoms
8422391100 088% write
I want StopWatch
to provide setTimeUnit(java.util.concurrent.TimeUnit)
, getLastTime(TimeUnit)
and getTotalTime(TimeUnit)
; the return type of these methods is double
.
For example,
StopWatch stopWatch = new StopWatch();
stopWatch.setTimeUnit(TimeUnit.MINUTES); // If not set, StopWatch is applied default TimeUnit.
stopWatch.start();
/* working... */
stopWatch.stop();
getTotalTime(TimeUnit.SECONDS); // 9.6248415
getTotalTime(); // 0.160414025 / Without param, it depends on StopWatch#timeUnit
System.out.println(stopWatch.prettyPrint());
is like ...
StopWatch '': running time = 0.160414025 min
---------------------------------------------
min % Task name
---------------------------------------------
0.02004084 012% createRandoms
0.140373185 088% write
Thanks!
teddylear and aircook
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement