Skip to content
Snippets Groups Projects
Commit 02049c13 authored by gwen-soleil's avatar gwen-soleil
Browse files

minor change to use TimeUnit to managed sleeps.

parent aa7c4f37
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ import static org.mockito.Mockito.when;
import java.lang.reflect.Array;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import fr.esrf.TangoApi.DeviceProxy;
import org.junit.AfterClass;
......@@ -314,7 +315,7 @@ public class TangoParserTest {
DevState startState = tangoParser.state();
try {
while (startState.equals(DevState.INIT) && timer > 0) {
Thread.sleep(stepTime);
TimeUnit.MILLISECONDS.sleep(stepTime);
startState = tangoParser.state();
System.out.println("State = " + startState);
timer -= stepTime;
......@@ -326,8 +327,9 @@ public class TangoParserTest {
}
if (launched) {
System.out.println("Device started in " + Double.toString((maximumTime - timer) / 1000.0) + " seconds.");
System.out.println("Device state: " + startState);
System.out.println("Device started in " + Double.toString(TimeUnit.MILLISECONDS.toSeconds(maximumTime - timer)) + " seconds.");
System.out.println("Device state: " + tangoParser.state());
System.out.println(tangoParser.status());
} else {
System.out.println("Device start up took too much time, aborting");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment