[common] tick a time routine for code profiling
commit959530d4e79001a1243a9bd1f201f2f37c1f7a1e
authorhsw@openmoko.com <hsw@openmoko.com@974c56cd-8151-0410-98c4-7bb2f43fa8c1>
Thu, 30 Apr 2009 11:01:10 +0000 (30 11:01 +0000)
committerHolger Freyther <ich@tamarin.(none)>
Sun, 3 May 2009 07:21:32 +0000 (3 09:21 +0200)
treef5cfe56582f92b78d62473a84a51570e4a69e481
parent7f7959bf10ee457e0936e2a984c0d1c57e98af94
[common] tick a time routine for code profiling

call like this:

  timer_initialise(); // place near start of program
  // ...

  unsigned int t1, t2;

  t1 = tick_get();
  // some code here
  t2 = tick_get();

  // show result (MCLK_MHz from wikireader.h)
  // use appropriate display
  DISPLAY("elapsed time = %u uS\n", (t2 - t1) / MCLK_MHz);

Note:
  Timer will be stopped by suspend, so disable this feature
  when profiling.

Signed-off-by: Christopher Hall <hsw@openmoko.com>
git-svn-id: https://wikipediardware.googlecode.com/svn/trunk@1473 974c56cd-8151-0410-98c4-7bb2f43fa8c1
common/regs.h
common/tick.c [new file with mode: 0644]
common/tick.h [new file with mode: 0644]
common/wikireader.h