note 87225 added to function.proc-nice

From: Date: Tue, 25 Nov 2008 13:22:11 +0000
Subject: note 87225 added to function.proc-nice
Groups: php.notes 
Request: Send a blank email to php-notes+get-146911@lists.php.net to get a copy of this message
Simple function for check process nice, by default returns nice of current process: <?php public static function getProcessNice ($pid = null) { if (!$pid) { $pid = getmypid (); } $res = ps -p $pid -o "%p %n"; preg_match ('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches); return array ('pid' => (isset ($matches[1]) ? $matches[1] : null), 'nice' => (isset ($matches[2]) ? $matches[2] : null)); } ?> ---- Server IP: 82.177.164.100 Probable Submitter: 217.153.19.74 ---- Manual Page -- http://www.php.net/manual/en/function.proc-nice.php Edit -- https://master.php.net/note/edit/87225 Del: integrated -- https://master.php.net/note/delete/87225/integrated Del: useless -- https://master.php.net/note/delete/87225/useless Del: bad code -- https://master.php.net/note/delete/87225/bad+code Del: spam -- https://master.php.net/note/delete/87225/spam Del: non-english -- https://master.php.net/note/delete/87225/non-english Del: in docs -- https://master.php.net/note/delete/87225/in+docs Del: other reasons-- https://master.php.net/note/delete/87225 Reject -- https://master.php.net/note/reject/87225 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146911) next »