In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to test hard disk speed with VB.NET". The content in the article is simple and clear, and it is easy to learn and understand. Please follow Xiaobian's train of thought to study and learn "how to test hard disk speed with VB.NET".
The day before yesterday, when I was testing the performance of the hard drive with SiSoftware Sandra 2004, I suddenly thought, is it all right to use the VB.NET test that I am familiar with? How do you do it exactly?
What we are most interested in is the continuous read and write speed of the hard disk at maximum load. In order to measure the average speed more accurately, I decided to write a 1GB file and then read it out. Considering that I don't want to spend more tasks on loops, I first set up a buffer large enough, and then write the buffer to the disk to maximize the load on the hard drive. Considering the reading mechanism of Windows, the hard disk test is not accurate, the read part of this program can only be used in the first run, the more times the test is run, the more the test is not accurate, and the write test can still keep the accuracy after running many times. Let's do it now.
Create a console project TestHarddisk in VB.NET, and then write the following program in Sub Main.
Sub Main () Dim I As Int32Dim f As New FileStream ("E:BigFile.big", FileMode.Create) Dim fw As New BinaryWriter (f) Dim fr As New BinaryReader (f) Dim Size As Int32 = 1024 * 1024 * 1024-1? 'File size = 1GBDim bufSize As Int32 = 30 * 1024 * 1024? 'Buffer Size = 30MBDim jLast As Int32 = bufSize-1Dim j As Int32Dim Bytes (bufSize) As ByteDim StartWrite As Date = Date.NowConsole.WriteLine ("Write Start at {0}", StartWrite) Console.WriteLine ("Creating...") For I = 0 To Size Step bufSize' 1GBfw.Write (Bytes) NextDim EndWrite As Date = Date.NowDim TimePassed As TimeSpan = EndWrite.Subtract (StartWrite) Console.WriteLine ("Write End at {0}", EndWrite) Console.WriteLine ("Time passed: {0}", TimePassed) Console.WriteLine ("Speed: {0}" 1000 / TimePassed.TotalSeconds) fw.Flush () Dim StartRead As Date = Date.NowConsole.WriteLine ("Read Start at {0}", StartRead) Console.WriteLine ("Reading") For I = 0 To Size Step bufSizeBytes = fr.ReadBytes (bufSize) NextDim EndRead As Date = Date.NowTimePassed = EndRead.Subtract (StartRead) Console.WriteLine ("Read End at {0}", EndRead) Console.WriteLine ("Time passed: {0}", TimePassed) Console.WriteLine ("Read speed: {0}", 1000 / TimePassed.TotalSeconds) Console.ReadLine () fw.Close () End Sub
Now test.
Hardware configuration:
Athlon 2500 + (running at 1.8G)
EPOX 8RDA3 + nForce2 motherboard
512DDR 400 (running at 400MHz)
ATA100 Seagate 7200.7 80GB 2MB
Software configuration:
Windows 2003 Server Standard Edition
Full set of the latest WHQL drivers
Visual Studio 2003, compiler selects Realse mode, turns on all optimization options.
The write speed 43MB/s is obtained in the first test, and 42MB/s is measured in the second time. The result of 43MB/s in the third 41MB/s test is not much different from that in Sisoftware test, which achieves ideal results. However, the read test is abnormal, the first time 64MB/s, and Sissoftware test around 5MB/s, the second time reached 1096MB/s, the third 1123MB/s, which and Windows disk buffer mechanism, it seems that the role is quite great, of course, it is recommended to read the test after restarting the computer.
Thank you for your reading, the above is the content of "how to use VB.NET to test hard disk speed". After the study of this article, I believe you have a deeper understanding of how to use VB.NET to test hard disk speed. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.