How can I find hard disk speed? I can not use System.IO.File.Copy and use timer to get hard disk speed, because after caching file, the speed will be really higher than real time.
What can I do instead?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The reason the subsequent read speed is much higher than expected after writing a file, is that the file is cached by the OS in the disk system cache when it is written i.e. in-memory. The subsequent file read is in effect being read from memory, rather than disk.
Please see this code project article which provides a solution for bypassing the OS disk cache by leveraging the FILE_FLAG_NO_BUFFERING flag:
http://www.codeproject.com/KB/files/unbuffered.aspx
This solution can be used in your context to avoid OS disk caching, and so obtain “real” disk speeds.