instruction executed per second by a microprocessor
-
what program i need to write to find out number of instuctions executed per second by my processor. i thought of sending an interrupt after 1 second to an executing program(loop) which has counter, so by calculating difference between initial and final value of counter for that program(loop) we can find out instruction executed per second. but unfortunetly i don't know how to send timing interrupt. i need suggestions and guidance. thank you
-
what program i need to write to find out number of instuctions executed per second by my processor. i thought of sending an interrupt after 1 second to an executing program(loop) which has counter, so by calculating difference between initial and final value of counter for that program(loop) we can find out instruction executed per second. but unfortunetly i don't know how to send timing interrupt. i need suggestions and guidance. thank you
Hi, the general question you ask needs an entire book to contain a general answer. Here are some facts: 1. you are in the wrong forum, it is not a software design/archiotecture issue, it depends foremost on the specific hardware. 2. Most microprocessors have some kind of NOP instruction, and can execute that in 1 cycle. So a 1GHz CPU (single core, no hyperthreading, ...) could execute 1 billion of those in one second. 3. More complex instructions may/will take longer; more so for CISC than for RISC. A divide instruction may take 35 cycles or so (or not be available at all). 4. Instruction scheduling nowadays complicates matter a lot: instructions don't always get executed at maximum theoretical speed due to scheduling constraints. 5. Memory bandwidth issues may slow things down (code cache misses, data cache misses, table walk delays) 6. Other system activity may reduce the throughput you are interested in: e.g. interrupts dealing with timer ticks, network traffic, ... :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google