aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-08-30 21:30:09 -0700
committeralon@honor <none@none>2010-08-30 21:30:09 -0700
commit50a1abf1ad3260d63f0ed0b3558e739ce5eb1f41 (patch)
tree1f491538b2388fd9a54bf773bed34b431f8dc42d /src/utility.js
parent100294df68fd63c1a80b81264cb98d772e7e09fc (diff)
imported patch optimize_enzymatic
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js
index bcff0b65..90805bad 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -127,3 +127,28 @@ function splitter(array, filter) {
return { leftIn: leftIn, splitOut: splitOut };
}
+DEBUG_TAGS_SHOWING = ['labelbranching', 'enzymatic'];
+function dcheck(tag) {
+ return DEBUG_TAGS_SHOWING.indexOf(arguments[0]) != -1;
+}
+function dprint() {
+ var text;
+ if (arguments[1]) {
+ if (!dcheck(arguments[0])) return;
+ text = arguments[1];
+ } else {
+ text = arguments[0];
+ }
+ text = '// ' + text;
+ print(text);
+}
+
+PROF_ORIGIN = Date.now();
+PROF_TIME = PROF_ORIGIN;
+function PROF(pass) {
+ if (!pass) {
+ dprint("Profiling: " + ((Date.now() - PROF_TIME)/1000) + ' seconds, total: ' + ((Date.now() - PROF_ORIGIN)/1000));
+ }
+ PROF_TIME = Date.now();
+}
+