扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
Sub Main() Dim I As Int32 Dim 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 = 1GB Dim bufSize As Int32 = 30 * 1024 * 1024 'Buffer Size = 30MB Dim jLast As Int32 = bufSize - 1 Dim j As Int32 Dim Bytes(bufSize) As Byte Dim StartWrite As Date = Date.Now Console.WriteLine("Write Start at {0}", StartWrite) Console.WriteLine("Creating...") For I = 0 To Size Step bufSize '1GB fw.Write(Bytes) Next Dim EndWrite As Date = Date.Now Dim 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.Now Console.WriteLine("Read Start at {0}", StartRead) Console.WriteLine("Reading") For I = 0 To Size Step bufSize Bytes = fr.ReadBytes(bufSize) Next Dim EndRead As Date = Date.Now TimePassed = 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 |
Athlon 2500+(running at 1.8G) EPOX 8RDA3+ nForce2主板 512DDR 400(running at 400MHz) ATA100 Seagate 7200.7 80GB 2MB |
Windows 2003 Server Standard Edition |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者