Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: how to get accurate timing on a CPU with multiple jobs
Date: Sat, 25 Jul 2009 05:48:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <h4e6ah$kcn$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1248500881 20887 172.30.248.37 (25 Jul 2009 05:48:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 25 Jul 2009 05:48:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1916180
Xref: news.mathworks.com comp.soft-sys.matlab:558253


I have a simple question for measuring how much CPU time is spent on a block of matlab code.  The key challenge is that the CPU may have some other people's jobs running at the same time, and my job may get only 20% of the total time.  The utilities provided by Matlab like "tic, toc, cputime, etime" are all for the case where the CPU is exclusively used by the single job.  I have read posts like http://www.mathworks.com/matlabcentral/fileexchange/18798, but none of them deals with the case of multiple task on single CPU.

I am using a community cluster (with Linux) to run experiments, so this is a problem.

Thank you in advance.