Skip to content

Commit

Permalink
Add memory usage and elapsed time statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
nohponex committed Jan 20, 2016
1 parent 0c7b639 commit a63e3f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ public function invoke()
echo ', ';
Binary::output('Unsuccessful: ' . $stats->error . PHP_EOL, 'red');


echo 'Memory usage: ' . (int)(memory_get_usage(true)/1048576) . ' MB' . PHP_EOL;
echo 'Elapsed time: ' . (time() - $_SERVER['REQUEST_TIME']) . ' s' . PHP_EOL;

if ($stats->error > 0) {
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ protected static function initializeGlobals()
return rand(0, $max);
};

static::$globals->{'rand-string'} = [Util::class, 'readableRandomString'];
static::$globals->{'rand-string'} = [Util::class, 'readableRandomString'];

static::$globals->{'rand-hash'} = function () {
static::$globals->{'rand-hash'} = function () {
return sha1(rand() . mt_rand() . rand());
};

Expand Down

0 comments on commit a63e3f3

Please sign in to comment.