[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Measure my hard disk speed

Posted on 1997-06-06
4
Medium Priority
?
323 Views
Last Modified: 2013-11-15
Hello, I know a little bit about C, I would like to have a source code in C (and the bynary too) that I can use to measure my hard disk speed (and probably another knid of hardware).

Can any of you help me please?.
0
Comment
Question by:aacosta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
Slarti earned 360 total points
ID: 1251001
First, the problems:
There is no way to know the exact speed of your hard disk. This is because factors such as disk caching (both software and hardware) cause actual transfer rates to vary from the expected values. Programs like Norton Utilities' SysInfo regularly give results which are about 2-3 ms faster than the actual speed. If you really want to find out what your disk speed is, the best way is to either open up the computer and look at it (most disks have this info written on them, along with some other technical details), or look it up in the hard disk's spec sheets (which can probably be found online, and should also have come with your hard disk).

But, if you still want to code a program that will measure disk speed (for instance as part of a program like SysInfo), here's what you need to know:
Disk speeds are measured by two factors: sequential speed and random-access speed. Sequential speeds are mostly affected by the disk transfer rate (which is also a function of the controller). They are basically the amount of time you wait between two sector reads when the two sectors come one after the other. I.e., the disk doesn't have to spin very much to get to the next sector, which is why this speed depends mostly on the trasnfer rate.
Random-access speed is the average amount of time you wait between two sector reads when the sectors are chosen randomly (as opposed to being one after the other). On the average, the amount of time you will have to wait is equal to the amount of time the disk takes to rotate by 180 degrees.
To do these tests, you will first have to find the number of sectors in the hard disk. The interrupts INT 41h and INT 46h are good for this purpose if you have an IDE. (Technical info about these interrupts can be found at http://www.ctyme.com/intr/rb-5790.htm).
You will then need to read sectors as described above. You can use the BIOS Int 13h, function 0Ah to do this (info about this interrupt at http://www.ctyme.com/intr/rb-0546.htm).

You should probably perform the tests many times (say 100 or so), so that the timing will be more accurate. Remember the PC timer only has an accurate of 1/55 sec.

If the above interrupt talk is above your level (you said you know "a little bit about C"), there are C functions defined in DOS.H which can be used to generate interrupts. (Do this in DOS mode - in Windows there are zillions of other factors affecting hard disk performance). The geninterrupt() function is an example. However, remember that interrupts reach right down into the heart of the computer and start messing around with what they find there, so novice programmers should be careful with these functions, especially when they involve disk access. However, if you do want to measure the actual disk speed, this is the way to do it.
0
 
LVL 1

Author Comment

by:aacosta
ID: 1251002
Excellent, your answer was great. I gonna try everything what you say, but if you can send my a C code to aacosta@c-com.net
it would be great.

Thanks.
0
 
LVL 1

Author Comment

by:aacosta
ID: 1251003
Excellent, your answer was great. I gonna try everything what you say, but if you can send my a C code to aacosta@c-com.net
It would be great.

Thanks.
0
 
LVL 1

Author Comment

by:aacosta
ID: 1251004
Hello, again, I've been trying to use the interrupts you suggested me but my computer always hang up (I have not damage anything).
Do you know someone or somewhere I can find the source code I need?
Thanks again, bye.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question