mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
minor changes
This commit is contained in:
parent
c05aa0be8e
commit
ebb85f3feb
1 changed files with 38 additions and 0 deletions
38
lib/util.js
38
lib/util.js
|
|
@ -491,6 +491,18 @@ Util = exports || {};
|
|||
return lRet;
|
||||
};
|
||||
|
||||
/**
|
||||
* exec function if it exist in object
|
||||
* @pArg
|
||||
*/
|
||||
Util.execIfExist = function(pObj, pName, pArg){
|
||||
var lRet;
|
||||
if(pObj)
|
||||
lRet = Util.exec(pObj[pName], pArg);
|
||||
|
||||
return lRet;
|
||||
};
|
||||
|
||||
/**
|
||||
* function do conditional save exec of function
|
||||
* @param pCondition
|
||||
|
|
@ -525,6 +537,32 @@ Util = exports || {};
|
|||
|
||||
return lRet;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* start timer
|
||||
* @pArg
|
||||
*/
|
||||
Util.time = function(pArg){
|
||||
var lRet,
|
||||
lConsole = Scope.console;
|
||||
|
||||
lRet = Util.execIfExist(lConsole, 'time', pArg);
|
||||
|
||||
return lRet;
|
||||
};
|
||||
/**
|
||||
* stop timer
|
||||
* @pArg
|
||||
*/
|
||||
Util.timeEnd = function(pArg){
|
||||
var lRet,
|
||||
lConsole = Scope.console;
|
||||
|
||||
lRet = Util.execIfExist(lConsole, 'timeEnd', pArg);
|
||||
|
||||
return this;
|
||||
};
|
||||
/**
|
||||
* Gets current date in format yy.mm.dd hh:mm:ss
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue