#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
module EchoServer
def receive_data(data)
send_data(data)
close_connection
puts "%.4f" % [(Time.now.to_f-$time)*1000]
$time = Time.now.to_f
end
end
$time = Time.now.to_f
GC.disable
EM.epoll
EventMachine::run do
host = '0.0.0.0'
port = 8001
EventMachine::start_server host, port, EchoServer
end