rotemdan / lzutf8.js

A high-performance Javascript string compression library
MIT License
322 stars 26 forks source link

Add support for options flag --timer which calculates time it takes to perform async compression and decompression #40

Open utkanpar opened 3 years ago

utkanpar commented 3 years ago

Hello, we have been using this lib to compress and decompress larger strings. For our use case we are using compressAsync function, and sync decompression. We want to run load test on our page and are interested in calculating the time the lib takes to perform async compression and decompression.

Can you please add an options flag to the async compression and decompression function which set to true, calculates the time it takes to compress/ decompress a string and we can read the timer value in the callback function?

Something like this: LZUTF8.compressAsync(input, {timer: true}, function (result, error, timer) { if (error === undefined && timer === undefined) { console.log("Data successfully compressed and encoded to " + result.length + " characters" + in "**timer**" ms); } });