You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
832 B

14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
  1. <?php
  2. /**
  3. * @copyright NetMonsters <team@netmonsters.ru>
  4. * @link http://netmonsters.ru
  5. * @package Majestic
  6. * @subpackage util
  7. * @since 2010-03-09
  8. * @version SVN: $Id$
  9. * @filesource $URL$
  10. */
  11. class CommandProfiler
  12. {
  13. protected $type;
  14. protected $command = '';
  15. protected $start = null;
  16. protected $end = null;
  17. public function __construct($type, $command)
  18. {
  19. $this->type = $type;
  20. $this->command = $command;
  21. $this->start = microtime(true);
  22. }
  23. public function end()
  24. {
  25. $this->end = microtime(true);
  26. }
  27. public function getCommand()
  28. {
  29. return $this->command;
  30. }
  31. public function getType()
  32. {
  33. return $this->type;
  34. }
  35. public function getElapsed()
  36. {
  37. return $this->end - $this->start;
  38. }
  39. }