mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
lib/svgo: store elapsed time in result object
This commit is contained in:
@ -48,6 +48,8 @@ module.exports = INHERIT(/** @lends SVGO.prototype */{
|
||||
*/
|
||||
fromString: function(str) {
|
||||
|
||||
var startTime = Date.now();
|
||||
|
||||
str = decodeSVGDatauri(str);
|
||||
|
||||
return this.config
|
||||
@ -61,6 +63,8 @@ module.exports = INHERIT(/** @lends SVGO.prototype */{
|
||||
result.info.inBytes = Buffer.byteLength(str, 'utf-8');
|
||||
result.info.outBytes = Buffer.byteLength(result.data, 'utf-8');
|
||||
|
||||
result.info.time = Date.now() - startTime;
|
||||
|
||||
return result;
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user