Beispiel #1
0
                     if ($extruder_current == 'T1') {
                         if ($temper_left == -1) {
                             $temper_left = (int) $string_temp;
                         }
                     }
                 }
             }
         }
     }
 }
 // count value of bed's temperature
 $pos_m190 = strpos($line, 'M190');
 if ($pos_m190 !== FALSE) {
     // do not count key word in comment
     if ($pos_comment !== FALSE && $pos_comment < $pos_m190) {
         do_nothing();
     } else {
         // get temperature
         $string_temp = '';
         $offset = 0;
         $pos_temp = strpos($line, 'S', 0);
         while ($pos_temp < $pos_m190) {
             ++$offset;
             $pos_temp = strpos($line, 'S', $offset);
         }
         $string_temp = substr($line, $pos_temp + 1);
         if ($temper_bed == -1) {
             $temper_bed = (int) $string_temp;
         }
     }
 }
Beispiel #2
0
    $assert_time = $end - $start;
    $start = microtime(true);
    for ($i = 0; $i < $iterations; $i++) {
        Assert::argument()->is_true(true)->is_true(true)->is_true(true)->is_true(true);
    }
    $end = microtime(true);
    $assert_time = $end - $start;
    $start = microtime(true);
    for ($i = 0; $i < $iterations; $i++) {
        if (!(true === true)) {
            throw new InvalidArgumentException("unacceptable!");
        }
        if (!(true === true)) {
            throw new InvalidArgumentException("unacceptable!");
        }
        if (!(true === true)) {
            throw new InvalidArgumentException("unacceptable!");
        }
        if (!(true === true)) {
            throw new InvalidArgumentException("unacceptable!");
        }
    }
    $end = microtime(true);
    $base_time = $end - $start;
    return [$base_time, $assert_time, $assert_time];
}
$is_true_results = is_true_bench_two_calls($iterations);
do_nothing($is_true_results);
$is_true_four_results = run_is_true_with_four_chains($iterations);
do_nothing($is_true_four_results);
echo "success!\n";