Skip to content

Instantly share code, notes, and snippets.

View manticorp's full-sized avatar

Harry Mustoe-Playfair manticorp

View GitHub Profile
@manticorp
manticorp / Simple timing class with iteration, max, min, averaging for benchmarking.
Last active December 14, 2015 20:19
A simple timing class. It's fairly self explanatory. It allows you set 'checks' and then print a list of those checks.It also supports iterations, so if you want to benchmark code fairly you can use the iterator function to do so.Simply set up a normal for loop, wrap it with startIteration and stopIteration, call the setIteration method with the…
<!-- styles for the timer -->
<style>
body{margin:0;padding:0}.manticorp-timing-container{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif}.manticorp-timing-container table{border-collapse:collapse;border:3px solid #555}.manticorp-timing-container tr:first-child td,.manticorp-timing-container tr:first-child th{text-align:center;border-bottom:2px solid #555}
.manticorp-timing-container tr:first-child:hover td,.manticorp-timing-container tr:first-child:hover th{background:#efefef}.manticorp-timing-container tr:hover td,.manticorp-timing-container tr:hover th{background:#ddd}.manticorp-timing-container td,.manticorp-timing-container th{padding:.4em 1em;-webkit-transition:background .06s;transition:background .06s;border-left:1px solid #555}
.manticorp-timing-container th{text-align:right;background:#efefef}.manticorp-timing-container .manticorp-timing-time{font-family:'Courier New',Courier,'Lucida Sans Typewriter','Lucida Typewriter',monospace}
.manticorp-timing-container .manticorp-timing-title{font-fam