· 6 years ago · Jun 18, 2019, 01:52 AM
1watch2.start();
2String EncMsg= AES256Test.encrypt(PlainMsg, secretKey) ; // PlainMsg is 344 byte
3watch2.stop();
4System.out.println("Time Elapsed: : " + watch2.getTime());
5// Prints: Time Elapsed: 319 ms.
6
7for (int i=0; i<=1000 ; i++)
8{
9watch2.start();
10String EncMsg= AES256Test.encrypt(PlainMsg, secretKey) ;
11watch2.stop();
12System.out.println("Time Elapsed: : " + watch2.getTime());
13
14// First iteration it prints: Time Elapsed: 319 ms.
15// Then for all other iterations it prints Time Elapsed: 0 ms.
16}