Permalink
Browse files

Bench some more.

  • Loading branch information...
ShaneMcC committed Dec 2, 2018
1 parent 0adb3b7 commit fd1af34e68187fc1dea2a55ee1e70b2151f2a5db
Showing with 7 additions and 3 deletions.
  1. +2 −2 config.php
  2. +5 −1 www/index.php
@@ -3,9 +3,9 @@
$resultsFile = __DIR__ . '/results.json';
$participantsDir = __DIR__ . '/participants/';
$repeatCount = 10;
$repeatCount = 20;
$longTimeout = 30;
$longRepeatCount = 4;
$longRepeatCount = 10;
$participants = [];
@@ -4,7 +4,7 @@
$pageid = 'index';
require_once(__DIR__ . '/header.php');
function getTime($times, $method = 'MIN') {
function getTime($times, $method = 'SPECIAL') {
$parsedTimes = [];
foreach ($times as $time) {
if (preg_match('#^([0-9]+)m\s?([0-9]+).([0-9]+)s$#', $time, $match)) {
@@ -18,6 +18,10 @@ function getTime($times, $method = 'MIN') {
}
switch ($method) {
case 'SPECIAL':
$parsedTimes = array_chunk($parsedTimes, count($parsedTimes) - 5)[0];
return array_sum($parsedTimes) / count($parsedTimes);
case 'AVG':
return array_sum($parsedTimes) / count($parsedTimes);

0 comments on commit fd1af34

Please sign in to comment.