tempo_inicial = $this->get_microtime(); $this->tempo_ultimo = $this->tempo_inicial; $this->tempo_total = 0; } function get_microtime() { list( $usec, $sec ) = explode( " ", microtime() ); return $usec + $sec; } function getTempoTotal() { return $this->tempo_total; } function marca( $str_nome = "" ) { if( ! $str_nome ) { $str_nome = "checkpoint " . count( $this->tomadas ) + 1; } $mictime = $this->get_microtime(); $this->tomadas[] = array( "nome" => $str_nome, "tempo_absoluto" => $mictime - $this->tempo_inicial, "diferenca_ultimo" => $mictime - $this->tempo_ultimo, "mictime" => $mictime ); $this->tempo_ultimo = $mictime; $this->tempo_total = $this->tempo_ultimo - $this->tempo_inicial; } function get_tabela( $html = false) { if( $html ) { $retorno = "
Nome | Tempo Absoluto | Diferenca Ultimo | MicroTime |
{$tomada["nome"]} | "; $retorno .= "" . number_format( $tomada["tempo_absoluto"], 10, ",", "." ) . " | "; $retorno .= "" . number_format( $tomada["diferenca_ultimo"], 10, ",", "." ) . " | "; $retorno .= "{$tomada["mictime"]} | "; $retorno .= "