How to measure execution time for a portion of VxWorks code using VxWorks 5.5 and Tornado 2
Use sysTimestamp() as documented in "VxWorks Device Driver Developer's Guide 6.2". This is the library used to measure time in WindView. If not already included, you need to include the system-defined timestamping in the VxWorks kernel. From the VxWorks tab of your bootable project in Tornado go to: "development tool components" -> "Windview components" -> "select timestamping" Right click on "system-defined timestamping" and choose "include 'system-defined timestamping'...", click "OK" Use sysTimestamp as shown in the example below:
void my_task()
{
UINT32 timestamp1, timestamp2;
double tsperiod, delta_time;
sysTimestampEnable();
tsperiod = (double)sysTimestampPeriod();
timestamp1 = sysTimestamp();
/* execute some code */
timestamp2 = sysTimestamp();
delta_time = (double)(timestamp2 - timestamp1)/tsperiod/sysClkRateGet();
exit(0);
}Technorati tags: vxworks
1
Comment
—
Comments feed for this post
Post a comment
About
I'm Eliot and this is my notepad for programming topics such as Python, Django, Ubuntu, Emacs, etc... more »
Search Blog
Tags
-
algorithms
(4)
-
aws
(8)
-
blogproject
(20)
-
c_cplusplus
(12)
-
cardstore
(8)
-
colinux
(2)
-
concurrency
(9)
-
conkeror
(2)
-
cygwin
(18)
-
datastructures
(15)
-
datetime
(3)
-
dell
(3)
-
django
(39)
-
emacs
(20)
-
files_directories
(10)
-
install_setup
(7)
-
javascript
(3)
-
keyboard
(6)
-
matplotlib
(5)
-
mercurial
(4)
-
nginx
(2)
-
preferences
(8)
-
processes
(3)
-
pyqt
(18)
-
python
(122)
-
ratpoison
(3)
-
regexes
(5)
-
rsync
(3)
-
softwaretools
(17)
-
sql
(13)
-
ssh
(7)
-
subversion
(6)
-
twisted
(6)
-
ubuntu
(60)
-
urxvt
(5)
-
vxworks
(25)
-
webservices
(4)
-
wmii
(7)
Blogroll
- Adam Gomaa
- Alex Clemesha
- Amir Salihefendic
- Armin Ronacher
- David Beazley
- David Ziegler
- Duncan McGreggor
- Gareth Rushgrave
- Glyph Lefkowitz
- Guido van Rossum
- Ian Bicking
- Jacob Kaplan-Moss
- James Bennett
- James Tauber
- Jesper Noehr
- Matt Harrison
- Nikolay Kolev
- Parand Darugar
- Peter Baumgartner
- Peter Bengtsson
- Rob Hudson
- Simon Willison
- Will McGugan
#1 Bruce Cran commented on 2007-10-18:
sysTimestampPeriod returns the number of ticks the timer counts before resetting - I think sysTimestampFreq should be used to get the frequency in ticks per second in order to calculate the delta time.