Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Joshimane_Result
- *
- * A class contains benchmarking result.
- *
- * @author Yuya Takeyama
- */
- class Joshimane_Result
- {
- /**
- * Constructor.
- *
- * @param array $params Parameters of the job result.
- * + begin float When the job had begun.
- * + end float When the job had ended.
- */
- public function __construct($params)
- {
- $this->_begin = $params['begin'];
- $this->_end = $params['end'];
- }
- /**
- * Gets the total time elapsed.
- *
- * @param string $format Format string passed to sprintf().
- * @return float|string
- */
- public function getTotalTime($format = NULL)
- {
- if (is_null($format)) {
- $result = $this->_end - $this->_begin;
- } else {
- $result = sprintf($format, $this->_end - $this->_begin);
- }
- return $result;
- }
- }
Add Comment
Please, Sign In to add comment