<?php // Initializing $arr = []; // Mocking for ($i = 0; $i < 400; $i++){ for ($j = 0; $j < 400; $j++){ $arr[$i][] = $j; } } // -------------------------------------------------------- // Start time tracking $time_start = microtime(true); for ($i = 0; $i < 400; $i++){ for ($j = 0; $j < 400; $j++){ if ($arr[$i][$j] > 0){ /* Do stuff */ } } } // Finish time tracking $time_end = microtime(true); // Execution time of the script $execution_time = ($time_end - $time_start)/60; echo 'Total Execution Time #1: '.$execution_time.' Secs' . PHP_EOL; // -------------------------------------------------------- // Start time tracking $time_start = microtime(true); for ($i = 0; $i < 400; $i++){ for ($j = 0; $j < 400; $j++){ if ($arr[$j][$i] > 0){ /* Do stuff */ } } } // Finish time tracking $time_end = microtime(true); // Execution time of the script $execution_time = ($time_end - $time_start)/60; echo 'Total Execution Time #2: '.$execution_time.' Secs';
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`