Skip to content

Instantly share code, notes, and snippets.

View gersongoulart's full-sized avatar

Gerson Goulart gersongoulart

  • Vancouver, BC, Canada
View GitHub Profile
function performanceTest(testFunction, iterations = 1000) {
var sum = 0;
var start = performance.now();
for (var i = 0; i < iterations; i++) {
testFunction();
}
var time=performance.now() - start;
console.log(time);
return time;
}
@gersongoulart
gersongoulart / grunt-groc.js
Last active December 11, 2015 05:28
Simple gruntjs/grunt task to generate documentation using nevir/groc.
module.exports = function(grunt) {
// Groc task to generate documentation.
grunt.registerTask('groc', 'groc processor.', function() {
var groc = require('groc');
var done = this.async();
var opts = grunt.config.get('groc');
var clis = [];
@gersongoulart
gersongoulart / DisplayMyName.js
Created April 11, 2012 17:52
Display current function name
function DisplayMyName() {
var myName = arguments.callee.toString();
myName = myName.substr('function '.length);
myName = myName.substr(0, myName.indexOf('('));
alert(myName);
}