Skip to content

Commit 87c404c

Browse files
committed
Use TimeUnit for sleeping for better readability
1 parent 954c0a6 commit 87c404c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/de/codecentric/performance/agent/allocation/AllocationProfilingAgent.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.io.StringWriter;
55
import java.lang.instrument.Instrumentation;
66
import java.lang.management.ManagementFactory;
7+
import java.util.concurrent.TimeUnit;
78

89
import javax.management.MBeanServer;
910
import javax.management.ObjectName;
@@ -47,7 +48,7 @@ public void run() {
4748
AgentLogger.log("Could not register Agent MBean in 10 minutes.");
4849
return;
4950
}
50-
Thread.sleep(10000l);
51+
TimeUnit.SECONDS.sleep(10);
5152
mbs = ManagementFactory.getPlatformMBeanServer();
5253
}
5354
mbs.registerMBean(new Agent(), new ObjectName("de.codecentric:type=Agent"));

0 commit comments

Comments
 (0)