Now we build a plugin skeleton to measure the time lapsed to execute the script. This maybe useful for plugin performance measurement. Therefore we introduce a switch (DEBUG_MODE_ACTIVE) at the beginning to use the function only for such purpose. DokuWiki delivers a global config parameter, which may be used instead (→config:allowdebug). To keep the focus on the main things, we reduced the simple script code to just stopping the script execution. For performance measurement issues it is necessary that the controlling function do not cause add significant delays. The proposed get_execution_time function is very small and simple to follow this rule.
Search the following code for DEBUG_MODE_ACTIVE and consider
To get the complete plugin please download: xm2stuff.zip