Exemple #1
0
        static void Main(string[] args)
        {
            Profiler profiler = new Profiler();
            profiler.StartMeasuringExecutionTime();

            new TPLTest().Start(Test.NumOfNodes);

            profiler.StopMeasuringExecutionTime();
            Console.WriteLine("... TPL executed for '" +
                profiler.Results() + "' seconds.");

            profiler.StartMeasuringExecutionTime();

            var runtime = PSharpRuntime.Create();
            Test.Execute(runtime);
            runtime.Wait();

            profiler.StopMeasuringExecutionTime();
            Console.WriteLine("... P# executed for '" +
                profiler.Results() + "' seconds.");
        }
Exemple #2
0
        void InitOnEntry()
        {
            int numOfNodes = (this.ReceivedEvent as Config).NumberOfNodes;

            this.Nodes = new List<MachineId>();

            Profiler profiler = new Profiler();
            profiler.StartMeasuringExecutionTime();

            for (int idx = 0; idx < numOfNodes; idx++)
            {
                var node = this.CreateMachine(typeof(Node));
                this.Nodes.Add(node);
            }

            profiler.StopMeasuringExecutionTime();
            Console.WriteLine($"... Created {numOfNodes} machines in '" +
                profiler.Results() + "' seconds.");
        }