@pokt-network/pocket-js
Version:
Pocket-js core package with the main functionalities to interact with the Pocket Network.
45 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProfileResult = void 0;
/**
*
*
* @class ProfileResult
*/
var ProfileResult = /** @class */ (function () {
/**
* Profile result.
* @constructor
* @param {string} blockKey - Code Block key name.
*/
function ProfileResult(blockKey) {
this.blockKey = blockKey;
this.timeElapsed = 0;
// Start the recording
this.startTime = new Date().valueOf();
}
/**
*
* Saves the current recording
* @returns {JSON} - JSON Object.
* @memberof ProfileResult
*/
ProfileResult.prototype.save = function () {
this.timeElapsed = new Date().valueOf() - this.startTime;
};
/**
*
* Returns an object with the recording results
* @returns {JSON} - JSON Object.
* @memberof ProfileResult
*/
ProfileResult.prototype.toJSON = function () {
return {
block_key: this.blockKey,
time_elapsed: this.timeElapsed
};
};
return ProfileResult;
}());
exports.ProfileResult = ProfileResult;
//# sourceMappingURL=profile-result.js.map