linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to mesure current SPI transfer speed
@ 2011-01-07 18:51 Kevyn-Alexandre Paré
  2011-01-08  2:16 ` Jassi Brar
  0 siblings, 1 reply; 4+ messages in thread
From: Kevyn-Alexandre Paré @ 2011-01-07 18:51 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	gumstix-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi,

What's the best way to calculate the current SPI transfer speed?

Right now I use something like that and transfer one spi_message with 1
spi_transfer of 100000 bytes and I do the math... I know that this is
not accurate and was wondering if anyone have a better way?


struct timeval tv_before;
struct timeval tv_after;

do_gettimeofday(&tv_before);
    status = spi_sync(spike_dev.spi_device, &spike_ctl.msg);
do_gettimeofday(&tv_after);
    long elapsedTime = (tv_after.tv_usec - tv_before.tv_usec);


Thx

--
Kevyn-Alexandre Pare


------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-12  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07 18:51 How to mesure current SPI transfer speed Kevyn-Alexandre Paré
2011-01-08  2:16 ` Jassi Brar
     [not found]   ` <AANLkTimexzqAafU7dWj8QY1Oaac5wUoEj=pp6gqkcuqE-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-10 20:25     ` Kevyn-Alexandre Paré
2011-01-12  2:29       ` Jassi Brar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).