AdvancedMultithreadingLab.TestInterlocked.Start C# (CSharp) Метод

Start() приватный Метод

private Start ( int processorId1, int processorId2 ) : double
processorId1 int
processorId2 int
Результат double
        private double Start( int processorId1, int processorId2 )
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            Thread thread1 = new Thread( this.ThreadMain );
            Thread thread2 = new Thread( this.ThreadMain );

            stopwatch.Start();

            thread1.Start( processorId1 );
            thread2.Start( processorId2 );

            thread1.Join();
            thread2.Join();

            double ns = 1e9 / ((double) n * Stopwatch.Frequency / stopwatch.ElapsedTicks);

            Console.WriteLine( "TestInterlocked({2},{3}): {0:0.0} MT/s ({1:0} ns/T)", 1e-6 * n * Stopwatch.Frequency / stopwatch.ElapsedTicks,
                               ns, processorId1, processorId2 );

            return ns;
        }

Same methods

TestInterlocked::Start ( ) : void