vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/lib/memcache.rb
### Statistics wrapper: increment the execution count and processor times
### for the given operation +type+ for the specified +server+.
Statistics wrapper: increment the execution count and processor times
for the given operation +type+ for the specified +server+.
Statistics wrapper : increment the execution count and processor times for the given operation + type + for the specified + server + .
def add_stat( type )
		raise LocalJumpError, "no block given" unless block_given?
		starttime = Process::times
		res = yield
		endtime = Process::times
		@stats[type][:count] += 1
		@stats[type][:utime]  += endtime.utime - starttime.utime
		@stats[type][:stime]  += endtime.stime - starttime.stime
		@stats_callback.call( type, starttime, endtime ) if @stats_callback
		return res
	end
def add_stat ( type ) raise LocalJumpError , "no block given" unless block_given? starttime = Process :: times res = yield endtime = Process :: times @stats [ type ] [ :count ] += 1 @stats [ type ] [ :utime ] += endtime . utime - starttime . utime @stats [ type ] [ :stime ] += endtime . stime - starttime . stime @stats_callback . call ( type , starttime , endtime ) if @stats_callback return res end
Statistics wrapper: increment the execution count and processor times
for the given operation +type+ for the specified +server+.
Statistics wrapper : increment the execution count and processor times for the given operation + type + for the specified + server + .
# Time the block # Add time/call stats callback
type