Package org.djutils.profile
Class ProfileTest
java.lang.Object
org.djutils.profile.ProfileTest
Test the Profile class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
delay
(long nanoSeconds) Delay for specified number of nano seconds.void
doCosine
(double angle) Perform a somewhat CPU time intensive function.void
doSine
(double angle) Perform a somewhat CPU time intensive function.void
Test the Profile class using busy waiting.void
Test the Profile class using sine and cosine.void
Calls start, but not end.void
Test handling of inappropriate calling sequences.
-
Constructor Details
-
ProfileTest
public ProfileTest()
-
-
Method Details
-
profileTestUsingTrigFunctions
@Test public void profileTestUsingTrigFunctions()Test the Profile class using sine and cosine. -
doSine
public void doSine(double angle) Perform a somewhat CPU time intensive function.- Parameters:
angle
- double; the argument
-
doCosine
public void doCosine(double angle) Perform a somewhat CPU time intensive function.- Parameters:
angle
- double; the argument
-
profileTestUsingBusyWaiting
Test the Profile class using busy waiting.- Throws:
InterruptedException
- if that happens; this test has failed
-
delay
Delay for specified number of nano seconds.
Derived from https://stackoverflow.com/questions/11498585/how-to-suspend-a-java-thread-for-a-small-period-of-time-like-100-nanoseconds- Parameters:
nanoSeconds
- long; time to delay in nano seconds- Returns:
- long; number of iterations in the busy waiting loop
- Throws:
InterruptedException
- If that happens; this test fails
-
testFailureModes
@Test public void testFailureModes()Test handling of inappropriate calling sequences. -
startOnly
public void startOnly()Calls start, but not end.
-