pventurino

Salesforce algorithm performance testing template

Nov 13th, 2015
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. Integer  loops = 1000;
  2. Datetime stime, etime; // Start time, end time
  3. String   results = '';
  4.  
  5. void logtime(String msg) {
  6.     results += '\n' + msg + ': ' + (etime.getTime() - stime.getTime()) + ' ms';
  7. }
  8.  
  9. // Repeat for each strategy
  10. stime = System.now();
  11. for (Integer i=0; i<loops; i++) {
  12.     // Write strategy here
  13. }
  14. etime = System.now();
  15. logtime('Your strategy');
  16.  
  17. System.debug(results);
Add Comment
Please, Sign In to add comment