Mercurial > hg > ltpda
view m-toolbox/classes/+utils/@helper/CPUbenchmark.m @ 19:69e3d49b4b0c database-connection-manager
Update ltpda_uo.fromRepository
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % CPU benchmarking for comparing speeds among different % architectures/computers. % % DESCRIPTION: CPUbenchmark provides a benchmark CPU time for comparison % among different architectures/computers. It gives the mean % CPU time and the mean error. % % CALL: [a, b] = CPUbenchmark; % % VERSION: $Id: CPUbenchmark.m,v 1.1 2011/02/03 13:34:47 congedo Exp $ % % HISTORY: 02-02-2011 G. Congedo % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [avgT,stdT]=CPUbenchmark avgT = zeros(10,1); stdT = avgT; for jj=1:10 m = zeros(100,1); for kk = 1:100 tic for i = 1:1e4 a = rand(10,10); a = a'; end m(kk)=toc; end avgT(jj) = mean(m); stdT(jj) = std(m)/sqrt(numel(m)); end avgT = mean(avgT); stdT = mean(stdT); end