JPROFILER-GETMICROTIME-001
JProfiler::getmicrotime()
JProfiler::getmicrotime / getMemory
Those profiler shortcuts were removed.
JProfiler::getmicrotime() → microtime(true) / memory_get_usage()
What you will see
- Call to undefined method ...::getmicrotime
- Call to undefined method ...::getMemory
Symptoms people search
debug timer fatal
Replace this code
Swap JProfiler::getmicrotime() for microtime(true) / memory_get_usage().
Joomla 3
Remove or stop calling this
$start = JProfiler::getmicrotime();Joomla 4 / 6
Use this instead
$start = microtime(true);How to fix it
- 1Use PHP native timing APIs.
- 2JProfiler::getInstance() still exists as namespaced Profiler.
Also known as
getmicrotime · JProfiler::getMemory
Related issues
- Joomla 3 → 4Joomla API
JRequest::getVar() and the whole JRequest API
JRequest::getVar() → $app->getInput()->get('id')
- Joomla 3 → 4Joomla API
JError / JException
JError::raiseError() → throw new RuntimeException() / try-catch
- Joomla 3 → 4PHP
JPATH_PLATFORM
JPATH_PLATFORM → Do not use — autoload instead
- Joomla 3 → 4Joomla API
isAdmin() / isSite()
$app->isAdmin() → $app->isClient('administrator') / isClient('site')
- Joomla 3 → 4Joomla API
Factory::getUri()
JFactory::getUri() → Uri::getInstance()
- Joomla 3 → 4Joomla API
Factory::getXml() / JXMLElement
JFactory::getXML() → SimpleXMLElement