Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program {
- static DateTime firstdate, lastdate;
- const int CHUNKSIZE = 10 * 1024 * 1024; // 10 MB.
- const int TRIALS = 10000;
- static void startmeasure() {
- firstdate = DateTime.Now;
- }
- static void stopmeasure() {
- lastdate = DateTime.Now;
- var duration = lastdate.Subtract(firstdate);
- Console.WriteLine("Test duration:" + duration.TotalSeconds.ToString());
- }
- static void Main(string[] args) {
- string input;
- do {
- input = Console.ReadLine();
- switch (input) {
- case "test":
- handletest();
- break;
- }
- } while (input != "exit");
- }
- static void handletest() {
- startmeasure();
- byte[] data;
- for (int i = 0; i < TRIALS; i++) {
- data = getdata(CHUNKSIZE);
- }
- stopmeasure();
- }
- static byte[] getdata(int size) {
- return new byte[size];
- }
- }
Add Comment
Please, Sign In to add comment