-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// function to calculate time taken to execute the function | ||
|
||
/* | ||
* @params func() code | ||
*/ | ||
|
||
function compileTime(func = () => {}) { | ||
if(!Object.prototype.toString.call(func) == '[object Function]'){ | ||
return new TypeError('compileTime() : Argument is not a function'); | ||
} | ||
console.time("Function"); | ||
func(); | ||
console.timeEnd("Function"); | ||
} | ||
|
||
compileTime(result()) | ||
|
||
export default compileTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import sumArray from './sumArray.js' | ||
import isAnagram from './isAnagram.js' | ||
import twoSum from './twoSum.js' | ||
import compileTime from './compileTime.js' | ||
|
||
export { sumArray }; | ||
export { sumArray,isAnagram,twoSum,compileTime }; |
Empty file.