-
Notifications
You must be signed in to change notification settings - Fork 36
Config run information
Bart van Hoekelen edited this page Jun 28, 2017
·
1 revision
Display the current username ('whoami') and the process id.
// Add namespace at the top
use Performance\Config;
// Set config
Config::setRunInformation(true);
Config::setRunInformation($status);
Item | Type | Accept | Default | Required |
---|---|---|---|---|
$status | bool |
true or false
|
false |
yes |
Note: pay attention the line 'Run by user ... on process id ... '.
use Performance\Performance;
use Performance\Config;
class Foo
{
public function __construct()
{
// Set config item for display user and process id
Config::setRunInformation(true);
$this->synchronizeTaskARun();
// Finish all tasks and show test results
Performance::results();
}
public function synchronizeTaskARun()
{
// Set point Task A
Performance::point(__FUNCTION__);
//
// Run code
usleep(2000);
//
// Finish point Task A
Performance::finish();
}
}
Return to wiki home page