コード例 #1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
         watch.Start();
         worldData.BuildPlanet(true);
         watch.Stop();
         Debug.Log("Time multithreaded: " + watch.ElapsedMilliseconds / 1000f);
     }
     else if (Input.GetKeyDown(KeyCode.R))
     {
         System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
         watch.Start();
         worldData.BuildPlanet(false);
         watch.Stop();
         Debug.Log("Time singlethreaded: " + watch.ElapsedMilliseconds / 1000f);
     }
 }