-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofiling.js
More file actions
15 lines (14 loc) · 530 Bytes
/
profiling.js
File metadata and controls
15 lines (14 loc) · 530 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Interface for profiler
var Profiler = {
start: function(id) {},
stop: function(id) {},
getProfile: function(id) {}
};
// Implementation of profiler for time.
var ProfileTime = function() { this.profiles = {}; }; // Implementation specific constructor
ProfileTime.prototype = Object.create(Profiler); // Implement interface
ProfileTime.prototype.start = function(id) {
this.profiles[id] = new Date().getTimestamp();
};
ProfileTime.stop = function(id) { /* ... */ };
ProfileTime.getProfile = function(id) { /* ... */ };