Created
September 27, 2013 13:55
-
-
Save phybros/6728972 to your computer and use it in GitHub Desktop.
More advanced usage of the stopwatch class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// create a new S3 instance | |
$s3 = new S3('my access key', 'my secret key'); | |
// start the timer | |
StopWatch::start(); | |
// read & send the file | |
$f = $s3->inputFile('file_to_upload.zip'); | |
$r = $s3->putObject($f, 'my-bucket-name', 'uploaded_file.zip', S3::ACL_PUBLIC_READ); | |
if ($r !== false) { | |
// check how long it took | |
echo "Elapsed time: " . StopWatch::elapsed() . " seconds"; | |
} else { | |
echo "S3 Error!"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment