473,434 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

How to count Number of Instructions executed in One Second

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

Nov 10 '07 #1
10 6554
On Nov 11, 12:12 am, "coaass...@gmail.com" <coaass...@gmail.com>
wrote:
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....

Nov 10 '07 #2
co*******@gmail.com schrieb:
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

--
"PS: Ein Realname wäre nett. Ich selbst nutze nur keinen, weil mich die
meisten hier bereits mit Namen kennen." -- Markus Gronotte aka "Makus"
aka "Kosst Amojan" aka "maqqusz" in de.sci.electronics
<45**********************@newsspool3.arcor-online.net>
Nov 10 '07 #3
co*******@gmail.com wrote:
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.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Nov 10 '07 #4
jacob navia wrote:
2) Run the loop for 100 seconds.

3) Divide.
Well, that should be actually

Run the loop 100 times!

Sorry

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Nov 10 '07 #5
jacob navia schrieb:
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

--
"PS: Ein Realname wäre nett. Ich selbst nutze nur keinen, weil mich die
meisten hier bereits mit Namen kennen." -- Markus Gronotte aka "Makus"
aka "Kosst Amojan" aka "maqqusz" in de.sci.electronics
<45**********************@newsspool3.arcor-online.net>
Nov 10 '07 #6
Johannes Bauer wrote:
jacob navia schrieb:
>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
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.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Nov 10 '07 #7
On Nov 11, 12:12 am, "coaass...@gmail.com" <coaass...@gmail.com>
wrote:
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....

Nov 11 '07 #8
co*******@gmail.com wrote:
On Nov 11, 12:12 am, "coaass...@gmail.com" <coaass...@gmail.com>
wrote:
>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.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Nov 11 '07 #9
"co*******@gmail.com" <co*******@gmail.comwrites:
On Nov 11, 12:12 am, "coaass...@gmail.com" <coaass...@gmail.com>
wrote:
>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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Nov 11 '07 #10
jacob navia schrieb:
I am sorry I told you anything. You should do your own homework!
Totally seconded.

Greetings,
Johannes

--
"PS: Ein Realname wäre nett. Ich selbst nutze nur keinen, weil mich die
meisten hier bereits mit Namen kennen." -- Markus Gronotte aka "Makus"
aka "Kosst Amojan" aka "maqqusz" in de.sci.electronics
<45**********************@newsspool3.arcor-online.net>
Nov 11 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: vic | last post by:
Hello, Dean Try this: select distinct c1, c2 into #tmp_1 from t1 select count(*) as cnt from #tmp_1 drop table #tmp_1 With best regards.
0
by: DataFreakFromUtah | last post by:
Hello! No question here, just a procedure for the archive. Search critera: count records imported count data imported count number of rows imported count number of records imported record import...
1
by: tranky | last post by:
hi, only one information,please... how to count number of anonymous online users? I use ASP.NET 2.0 thank u tranky
5
by: isabelle | last post by:
hi, every body.. I have two program I couldn’t solve them So, can any body help me. please!! 1-Write a program that accepts a character and count number of occurrences in a file. The file...
11
by: Mack | last post by:
Hi all, I want to write a program to count number of bits set in a number. The condition is we should not loop through each bit to find whether its set or not. Thanks in advance, -Mukesh
2
by: mfaisalwarraich | last post by:
Hi Everybody, I am using the following code to get the recordset of an external database. Dim dbPatients As Database Dim rsCountPatients As Recordset ' to count number of...
5
by: jambonjamasb | last post by:
I am wanting to create a report that summarises the number of items within a date range. For example I have a FIELD called System_Change. This is a drop down COMBOBOX that uses words like unix,...
1
by: jlt206 | last post by:
This code <?php include("counter.php")?> on the webpage produces the count number. (function code below) I want to place the current number into a variable $MemberNo or into a FormField to be sent...
6
by: cathrine babe | last post by:
How To Count Number Of Words In A Sentence
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.