[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