1
0
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:
deepsweet
2012-12-14 05:56:24 +04:00
parent 0229a4029f
commit 74bbdb46cc
4 changed files with 52 additions and 36 deletions

View File

@ -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;
});