linux c下可以用posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED)清除指定文件的缓存。在windows下用什么可以清除缓存呢?
原因是因为我要测试从磁盘读取数据的速度,如果有缓存就测的不准了。
学习是最好的投资!
Use CreateFile to open the data and set the Flag of the penultimate parameter to FILE_FLAG_NO_BUFFERING. It has the same effect as POSIX_FADV_DONTNEED of posix_fadvise.
posix_fadvise
Use CreateFile to open the data and set the Flag of the penultimate parameter to FILE_FLAG_NO_BUFFERING. It has the same effect as POSIX_FADV_DONTNEED of
posix_fadvise
.