public static function timeFunc($iterations, $function, &$output = null){

    $time = 0;

    for($i = 0; $i < $iterations; $i++){
      $start  = microtime(true);
      $output = call_user_func($function);
      $time  += microtime(true) - $start;
    }

    return round($time, 4);
  }