Skip to content

Instantly share code, notes, and snippets.

@alickmail
Created October 1, 2019 16:12
Show Gist options
  • Save alickmail/33c359276eaf73db79bede224ac9cd35 to your computer and use it in GitHub Desktop.
Save alickmail/33c359276eaf73db79bede224ac9cd35 to your computer and use it in GitHub Desktop.
import {assert} from "chai";
import {EncryptionService} from "../Services/EncryptionService";
import * as crypto from 'crypto';
describe('encryption', () => {
const encryptionService: EncryptionService = new EncryptionService();
// 1000 * 10 Loops: 5.2 seconds
it('encryption performance test', () => {
const loop = 1000 * 10; // should use 1000 * 10
const message = Buffer.alloc(1000 * 100);
console.time('case1');
for (let i = 0; i < loop; i++) {
const signedMessage = encryptionService.signMessage(message);
const openedMessage = encryptionService.signOpenMessage(signedMessage);
}
console.timeEnd('case1');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment