 ##
 ## ThreeBSP.Node
 class ThreeBSP.Node
-  clone: => returning (node = new ThreeBSP.Node()), =>
+  clone: => returning (node = new ThreeBSP.Node(@options)), =>
     node.divider  = @divider?.clone()
-    node.polygons = (p.clone() for p in @polygons)
-    node.front    = @front?.clone()
-    node.back     = @back?.clone()
-    node.options  = @options
+    node.polygons = @options.timer.doTask => (p.clone() for p in @polygons)
+    node.front    = @options.timer.doTask => @front?.clone()
+    node.back     = @options.timer.doTask => @back?.clone()
+
 
   constructor: (polygons, @options={}) ->
     if polygons? and not (polygons instanceof Array)

  value

class Timelimit
  constructor: (@timeout=1000) -> "NOTHING"

  check: =>
    return unless @started?

    @started ?= Date.now()
    @tasks ?= 0
    @tasks += 1
    do @check

  finish: =>
    throw new Error("Finished more tasks than started") if @tasks? and @tasks < 1
    @tasks -= 1
    elapsed = @check()
    if @tasks == 0
      @started = undefined

  doTask: (block) =>
