Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
d0fc1a35
Commit
d0fc1a35
authored
Jun 25, 2023
by
gechengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交StopWatchTest测试类
parent
bb7fe6b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
StopWatchTest.java
...c/test/java/com/ceb/gjjs/mda/junitTest/StopWatchTest.java
+40
-0
No files found.
gjjs-bd-business/src/test/java/com/ceb/gjjs/mda/junitTest/StopWatchTest.java
0 → 100644
View file @
d0fc1a35
package
com
.
ceb
.
gjjs
.
mda
.
junitTest
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.util.StopWatch
;
public
class
StopWatchTest
{
@Test
public
void
test
()
{
StopWatch
stopWatch
=
new
StopWatch
(
"test1"
);
stopWatch
.
start
(
"任务1"
);
method1
();
stopWatch
.
stop
();
stopWatch
.
start
(
"任务2"
);
method2
();
stopWatch
.
stop
();
System
.
out
.
println
(
"totalTime="
+
stopWatch
.
getTotalTimeMillis
());
System
.
out
.
println
(
"print="
+
stopWatch
.
prettyPrint
());
}
public
void
method1
()
{
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
public
void
method2
()
{
try
{
Thread
.
sleep
(
2000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment