Exemple #1
0
 /** Run a 10 Hz clock for 4 seconds. */
 public final void runAt10HzFor4Seconds() {
   JVMClock c1 = new JVMClock("10 Hz", 10);
   for (int t = 0; t < 4; t++) {
     for (int i = 0; i < 10; i++) {
       c1.fullTick(true);
     }
   }
 }
Exemple #2
0
 /** Run a 2 Hz clock for 3 seconds. */
 public final void runAt2HzFor3Seconds() {
   JVMClock c1 = new JVMClock("2 Hz", 2);
   // 1
   c1.halfTick(true);
   c1.halfTick(true);
   c1.halfTick(true);
   c1.halfTick(true);
   // 2
   c1.halfTick(true);
   c1.halfTick(true);
   c1.halfTick(true);
   c1.halfTick(true);
   // 3
   c1.halfTick(true);
   c1.halfTick(true);
   c1.halfTick(true);
   c1.halfTick(true);
 }
Exemple #3
0
 /** Run a 1000 Hz clock for 0.1 seconds. */
 public final void runAt1000HzFor10thSeconds() {
   JVMClock c1 = new JVMClock("1000 Hz", 1000);
   for (int i = 0; i < 100; i++) {
     c1.fullTick(true);
   }
 }