 +            doneChunks.clear();
 +        }
 +
-+        final long time = -System.currentTimeMillis();
++        final long startTime = System.nanoTime();
  
          while (var3.hasNext())
          {
-@@ -308,14 +331,16 @@
+@@ -308,14 +331,18 @@
              Chunk var7 = this.getChunkFromChunkCoords(var4.chunkXPos, var4.chunkZPos);
              this.moodSoundAndLightCheck(var5, var6, var7);
              this.theProfiler.endStartSection("tickChunk");
 -            var7.updateSkylight();
-+            if (System.currentTimeMillis() + time <= 4 && doneChunks.add(var4)) { //Limits and evenly distributes the lighting update time
++            //Limits and evenly distributes the lighting update time
++            if (startTime - System.nanoTime() <= 4000000 && doneChunks.add(var4)) 
++            { 
 +                var7.updateSkylight();
 +            }
              this.theProfiler.endStartSection("thunder");

             {
                 this.updateLCG = this.updateLCG * 3 + 1013904223;
                 var8 = this.updateLCG >> 2;
@@ -332,7 +357,7 @@
             this.theProfiler.endStartSection("iceandsnow");
             int var13;
 

     }
 
     protected void initialize(WorldSettings par1WorldSettings)
@@ -753,7 +799,7 @@
      */
     protected void createBonusChest()
     {
