Member Login
Search
Jump to a Date
Sponsored Communities
Cool stuff
Neat Stuff

Visit our shop for nerds in control lifestyle products.
Thermal Overload
The threads that wouldn't die...
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
Fortune
"Power corrupts. Absolute power is kind of neat"
-- John Lehman, Secretary of the Navy 1981-1987
-- John Lehman, Secretary of the Navy 1981-1987
RSS Feed
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Hi,
I need to find out the number of instructions executed by my processor per sec.
I wrote a code with 10 simple instructions in a loop. Now I want to sent an interrupt to this program after 1 sec. so that I can count the number of instruction executed per second. How can I set my RTI to 1 sec. and how can I interrupt my program?
I need to find out the number of instructions executed by my processor per sec.
I wrote a code with 10 simple instructions in a loop. Now I want to sent an interrupt to this program after 1 sec. so that I can count the number of instruction executed per second. How can I set my RTI to 1 sec. and how can I interrupt my program?
I would suggest turning the problem around the other way. Run a set number of loops, and time how long it takes to execute it. Then you just need a
precision timing function. Run the loop with various numbers of iterations so you can extrapolate the timing overhead (assuming this is a linear function).
For timing, the POSIX C documentation states:
NAME
gettimeofday - get the date and time
SYNOPSIS
[XSI] [Option Start] #include <sys/time.h>
int gettimeofday(struct timeval *restrict tp, void *restrict tzp); [Option End]
DESCRIPTION
The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since the Epoch, and store it in the timeval structure pointed to by tp. The resolution of the system clock is unspecified.
If tzp is not a null pointer, the behavior is unspecified.
RETURN VALUE
The gettimeofday() function shall return 0 and no value shall be reserved to indicate an error.
ERRORS
No errors are defined.
precision timing function. Run the loop with various numbers of iterations so you can extrapolate the timing overhead (assuming this is a linear function).
For timing, the POSIX C documentation states:
NAME
gettimeofday - get the date and time
SYNOPSIS
[XSI] [Option Start] #include <sys/time.h>
int gettimeofday(struct timeval *restrict tp, void *restrict tzp); [Option End]
DESCRIPTION
The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since the Epoch, and store it in the timeval structure pointed to by tp. The resolution of the system clock is unspecified.
If tzp is not a null pointer, the behavior is unspecified.
RETURN VALUE
The gettimeofday() function shall return 0 and no value shall be reserved to indicate an error.
ERRORS
No errors are defined.
From Control Engineering magazine...
Related articles from Control
Engineering magazine- Rockwell Automation releases VantagePoint for plant data visualization
- Industrial Ethernet advantages using Profinet protocol
- Tips for sustainability in manufacturing
- Deadline extended: Nominate award winning products now for upcoming competition
- Video listen in: Making Coriolis two-wire demands small sacrifices
- Innovative manufacturing companies have a profit advantage over low-price firms
- Fieldbus Foundation Seminar: Chicago
- Radios for long-distance use in industrial mesh network
- Fast HMI application development software
- HMIs: Rugged, instrument-grade-glass on projected capacitive touchscreens
Above articles copyright 2008 Reed Business Information.
Subject to its Terms of Use.
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Patronize our advertisers!




