How to count Number of Instructions executed in One Second

C

coaassign

Hi all

I need to get a count the no of instructions [ even assembly language
instructions ] executed in a for loop in exactly one second...
Can any one please give me the code for this...

THANKS IN ADVANCE
 
C

coaassign

Hi all

I need to get a count the no of instructions [ even assembly language
instructions ] executed in a for loop in exactly one second...
Can any one please give me the code for this...

THANKS IN ADVANCE

Please give me the code for this in C language....
 
J

Johannes Bauer

Please give me the code for this in C language....

Your problem is not solvable by means the C language provides. It can
(maybe) be solved by means your architecture provides (using inline
assembly). But as this is architecture specific and you don't provide
which architecture you're working on - lost cause.

You don't even provide a name... so... lost cause anyways, I guess.

Greetings,
Johannes
 
J

jacob navia

Hi all

I need to get a count the no of instructions [ even assembly language
instructions ] executed in a for loop in exactly one second...
Can any one please give me the code for this...

THANKS IN ADVANCE

One method would be:

1) Count the number of instructions in your loop by getting
an assembly listing from the C compiler.
2) Run the loop for 100 seconds.

3) Divide.

4) Done.
 
J

Johannes Bauer

jacob said:
One method would be:

1) Count the number of instructions in your loop by getting
an assembly listing from the C compiler.

This is with high likelyhood not the actual number of executed
instructions, as on any modern operating system the sleeping process
will be preempted and instructions will be executed by the
scheduler/operating system/other tasks.

It would be the correct count if the process had exclusive access to the
CPU.

In any case, the problem is poorly specified.

Greetings,
Johannes
 
J

jacob navia

Johannes said:
This is with high likelyhood not the actual number of executed
instructions, as on any modern operating system the sleeping process
will be preempted and instructions will be executed by the
scheduler/operating system/other tasks.

It would be the correct count if the process had exclusive access to the
CPU.

In any case, the problem is poorly specified.

Greetings,
Johannes

Obvious. But I thought that the answer referred to the number
of assembly instructions executed by the program...

If the loop is short, the machine is lightly loaded, running 100
loop executions could get below the task time slot and be
executed without any task switch, but that is pure speculation.

You are right that the problem is poorly specified.
 
S

santosh

Hi all

I need to get a count the no of instructions [ even assembly language
instructions ] executed in a for loop in exactly one second...
Can any one please give me the code for this...

THANKS IN ADVANCE

Please give me the code for this in C language....

<OT>

No need. Since you're (apparently) running under Linux just check the
value for "BOGO MIPS" printed by the kernel as it boots up. Do 'dmesg |
grep MIPS' to view it.

</OT>
 
C

coaassign

Hi all

I need to get a count the no of instructions [ even assembly language
instructions ] executed in a for loop in exactly one second...
Can any one please give me the code for this...

THANKS IN ADVANCE

THE ACTUAL PROBLEM IS AS FOLLOWS.....

Write a program (AND/OR manipulate) existing DOS program so as to
count the number of

instructions executed by the p4 processor in the IBM thinkcenter
PC .You can

show any instruction mix executed . Count the exact number of each
distinct

instruction in the total mix executed in one second .After
demonstrating the setup &

the count explain the counts thoroughly....

THE ASSEMBLY INSTRUCTION MIX CAN BE ANYTHING....
 
J

jacob navia

Hi all

I need to get a count the no of instructions [ even assembly language
instructions ] executed in a for loop in exactly one second...
Can any one please give me the code for this...

THANKS IN ADVANCE

THE ACTUAL PROBLEM IS AS FOLLOWS.....

Write a program (AND/OR manipulate) existing DOS program so as to
count the number of

instructions executed by the p4 processor in the IBM thinkcenter
PC .You can

show any instruction mix executed . Count the exact number of each
distinct

instruction in the total mix executed in one second .After
demonstrating the setup &

the count explain the counts thoroughly....

THE ASSEMBLY INSTRUCTION MIX CAN BE ANYTHING....

I am sorry I told you anything. You should do your own homework!
The purpose of homework is to make you learn the issues discussed
in the lessons. If you cheat, you do not learn anything.

Do not cheat.
 
K

Keith Thompson

I need to get a count the no of instructions [ even assembly language
instructions ] executed in a for loop in exactly one second...
Can any one please give me the code for this...

THANKS IN ADVANCE

THE ACTUAL PROBLEM IS AS FOLLOWS.....

Write a program (AND/OR manipulate) existing DOS program so as to
count the number of

instructions executed by the p4 processor in the IBM thinkcenter
PC .You can

show any instruction mix executed . Count the exact number of each
distinct

instruction in the total mix executed in one second .After
demonstrating the setup &

the count explain the counts thoroughly....

THE ASSEMBLY INSTRUCTION MIX CAN BE ANYTHING....

THE ACTUAL ANSWER IS AS FOLLOWS.....

Do your own homework.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top