Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
"Power corrupts. Absolute power is kind of neat"
-- John Lehman, Secretary of the Navy 1981-1987
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the assembly department...
Real time interrupts for Pentium 4
Engineering and workplace issues. topic
Posted by akhshay on 14 November, 2007 - 12:13 am
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?


Posted by Michael Griffin on 14 November, 2007 - 11:40 pm
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.

From Control Engineering magazine...
Related articles from Control Engineering magazine
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.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Internet Explorer 6.0 Fix

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!