Advertisement
Guest User

Untitled

a guest
Sep 10th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2. define("CHARACTERS", "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
  3. function RandomString() {
  4. $randstring = '';
  5. for ($i = 0; $i < 32; $i++) {
  6. $randstring .= CHARACTERS[rand(0, 61)];
  7. }
  8. return $randstring;
  9. }
  10.  
  11. $time_start = time();
  12.  
  13. for($i = 0; $i<1000000; $i++) {
  14. md5(RandomString());
  15. }
  16. $time_end = time();
  17. $execution_time = ($time_end - $time_start);
  18. ?>
  19. <!DOCTYPE html>
  20. <html>
  21. <head>
  22. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  23. <meta charset="UTF-8">
  24. <title>Test PHP Page</title>
  25. <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic&amp;subset=latin,latin-ext,cyrillic-ext" rel="stylesheet" type="text/css">
  26. <link rel="stylesheet" href="/css/style.css">
  27. </head>
  28. <body>
  29. <div class="page-wrapper">
  30. <div id="page-content">This shit had <?php echo $execution_time; ?> seconds to execute</div>
  31. </div>
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement