var prevtime = Date.now(); function mtime(key){ var t = Date.now(); console.log(key,t-prevtime); prevtime = t; } buildOpt : function( obj, func ) { mtime("build begins"); COpt.jqo_ctar.html(""); COptRefCnt.init(); CCMS.trigger("opt-create"); COptRefCnt.setup(this,function(){ mtime("create ends"); COptRefCnt.init(); CCMS.trigger("opt-setup"); COptRefCnt.setup(this,function(){ mtime("setup ends"); this.checkWidthChange(); CCMS.trigger("opt-update"); mtime("update ends"); func.call(obj); }); }); },