             }
         }
     }
+    
+    // MARK: Helper
+    
+    private func setupTpsLabel() {
+        let label = UILabel(frame: CGRect(x: 4, y: 20, width: 60, height: 15))
+        label.textColor = UIColor.whiteColor()
+        label.font = UIFont(name: "Menlo", size: 10)
+        view?.addSubview(label)
+        
+        tpsLabel?.removeFromSuperview()
+        tpsLabel = label
+    }
+    
+    private func setTpsLabelCount(count: Int) {
+        tpsLabel?.text = "tps: \(count).0"
+    }
 }

                    if self.currentTime > 1.0+self.startTimeInterval {
                        let tps = min(self.currentTPS, self.tps)
                        dispatch_async(dispatch_get_main_queue()) {
                            self.tpsLabel?.text = "tps: \(tps).0"
                        }
                        self.currentTPS = 0
                        self.startTimeInterval = self.currentTime

    /// Note that when you override this method, you need to call
    /// its super method.
    public override func didMoveToView(view: SKView) {
        setupTpsLabel()
        tpsLabel?.hidden = !showsTPS
        setTpsLabelCount(0)
    }
    
    /// Called immediately before a scene is removed from a view.
