Skip to content

Instantly share code, notes, and snippets.

@drewm
Created December 13, 2010 10:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewm/738877 to your computer and use it in GitHub Desktop.
Save drewm/738877 to your computer and use it in GitHub Desktop.
Artificially delay the loading of images to simulate a slow connection
<?php
/*
Artificially delay the loading of images to simulate a slow connection
<img src="/slow_image_loader.php?img=realimage.jpg" />
*/
$image = $_GET['img'];
// delay between 1 and 3 seconds
usleep(rand(1000000,3000000));
header("Location: ".$image);
exit;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment