예제 #1
0
        public void RegistrarTime(MTouchRegistrar registrarMode)
        {
            using (var buildTool = new MTouchTool()) {
                var registrarModeName = Enum.GetName(typeof(MTouchRegistrar), registrarMode);
                buildTool.Profile   = profile;
                buildTool.Registrar = registrarMode;
                buildTool.NoFastSim = true;
                buildTool.CreateTemporaryApp(true, "RegistrarTime" + registrarModeName + profile);

                var sw = new Stopwatch();
                sw.Start();
                buildTool.Execute(MTouchAction.BuildSim);
                sw.Stop();
                var buildTime = sw.Elapsed.TotalSeconds;

                var launchTool = new MLaunchTool();
                launchTool.AppPath = buildTool.AppPath;
                launchTool.Profile = profile;

                sw.Reset();
                sw.Start();
                launchTool.Execute();
                sw.Stop();
                var launchTime = sw.Elapsed.TotalSeconds;

                var totalTime = buildTime + launchTime;
                sb.AppendLine(string.Format("RegistrarTime - {0}: {1} seconds [build time], {2} seconds [launch time], {3} seconds [total time]", registrarModeName, buildTime.ToString("#.000"), launchTime.ToString("#.000"), totalTime.ToString("#.000")));
            }
        }
예제 #2
0
        public TimingTests(MTouch.Profile profile)
        {
            this.profile = profile;

            // Create dummy app to initialize the simulator.
            using (var buildTool = new MTouchTool()) {
                buildTool.Profile = profile;
                buildTool.CreateTemporaryApp(true);
                buildTool.Execute(MTouchAction.BuildSim);
                var mlaunch = new MLaunchTool();
                mlaunch.AppPath = buildTool.AppPath;
                mlaunch.Profile = profile;
                mlaunch.Execute();
            }
        }
예제 #3
0
        public void AppLaunchTime()
        {
            using (var buildTool = new MTouchTool()) {
                buildTool.Profile = profile;
                buildTool.CreateTemporaryApp(profile, true, "AppLaunchTime" + profile);

                buildTool.Execute(MTouchAction.BuildSim);

                var sw         = new Stopwatch();
                var launchTool = new MLaunchTool();
                launchTool.AppPath = buildTool.AppPath;
                launchTool.Profile = profile;

                sw.Start();
                launchTool.Execute();
                sw.Stop();

                Console.WriteLine("TimingTests - AppLaunchTime ({0}): {1} seconds", profile, sw.Elapsed.TotalSeconds.ToString("#.000"));
            }
        }