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.

43 lines
789 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. */
  9. class CommandProfiler
  10. {
  11. protected $type;
  12. protected $command = '';
  13. protected $start = null;
  14. protected $end = null;
  15. public function __construct($type, $command)
  16. {
  17. $this->type = $type;
  18. $this->command = $command;
  19. $this->start = microtime(true);
  20. }
  21. public function end()
  22. {
  23. $this->end = microtime(true);
  24. }
  25. public function getCommand()
  26. {
  27. return $this->command;
  28. }
  29. public function getType()
  30. {
  31. return $this->type;
  32. }
  33. public function getElapsed()
  34. {
  35. return $this->end - $this->start;
  36. }
  37. }