Run this from an ec2 instance in the us-west-1 region.
It will create two queues and feed messages into the first queue with a timestamp, this message will then be read and the difference between the message timestamp and the current time computed and pushed into a response queue. Reading these times will give you the latency between publishing to a queue and receiving the message.
updated to print out the average, median, max and min response times.
when cpu is maxed out the latency increases significantly (to be expected)
sampling of 6112 requests shows max latency of 210ms and an average of 27ms.
0.0271480476113 0.023215 6112 0.210955 0.011464