コード例 #1
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("Usage: benchmrk <name> [<mask>*]");
                return;
            }


            string name = args[0];

            string[] masks;
            if (args.Length < 2)
            {
                masks = null;
            }
            else
            {
                masks = new string[args.Length - 1];
                Array.Copy(args, 1, masks, 0, masks.Length);
            }

            if (masks == null)
            {
                Console.WriteLine("No mask provided - creating baseline");
            }

            Testrun run = new Testrun(
                BUFFER_COUNT,
                BUFFER_SIZE,
                TRACE_BASE_DIR + name + ".jtrc",
                masks);
            TimeSpan elapsed = run.run(
                delegate {
                for (int i = 0; i < 1; i++)
                {
                    Console.Write("Build #{0}...", i);
                    Stopwatch watch = new Stopwatch();
                    watch.Start();

                    Helpers.RunShellCommand(
                        String.Format("cd /d \"{0}\" && setenv.bat && clean.bat && build.bat", WRK_BASE_DIR));

                    watch.Stop();
                    Console.WriteLine("{0} ms", watch.ElapsedMilliseconds);
                }
            });

            Console.WriteLine("{0} elapsed ({1} ms)", elapsed, elapsed.TotalMilliseconds);

            //
            // Forcefully exit.
            //
            Console.WriteLine("Committing suicide...");
            System.Diagnostics.Process.GetCurrentProcess().Kill();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ryoon/ntrace
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("Usage: benchmrk <name> [<mask>*]");
                return;
            }

            string name = args[0];
            string[] masks;
            if (args.Length < 2)
            {
                masks = null;
            }
            else
            {
                masks = new string[args.Length - 1];
                Array.Copy(args, 1, masks, 0, masks.Length);
            }

            if (masks == null)
            {
                Console.WriteLine("No mask provided - creating baseline");
            }

            Testrun run = new Testrun(
                BUFFER_COUNT,
                BUFFER_SIZE,
                TRACE_BASE_DIR + name + ".jtrc",
                masks);
            TimeSpan elapsed = run.run(
                delegate {
                    for (int i = 0; i < 1; i++)
                    {
                        Console.Write("Build #{0}...", i);
                        Stopwatch watch = new Stopwatch();
                        watch.Start();

                        Helpers.RunShellCommand(
                            String.Format("cd /d \"{0}\" && setenv.bat && clean.bat && build.bat", WRK_BASE_DIR));

                        watch.Stop();
                        Console.WriteLine("{0} ms", watch.ElapsedMilliseconds);
                    }
                });

            Console.WriteLine("{0} elapsed ({1} ms)", elapsed, elapsed.TotalMilliseconds);

            //
            // Forcefully exit.
            //
            Console.WriteLine("Committing suicide...");
            System.Diagnostics.Process.GetCurrentProcess().Kill();
        }