Reading the Position Attribute

#!/usr/bin/env python
#
# this script reads the position of a motor 10000 times 
# and measures the total time
#
# result: local I/O: 4 kHz, remote I/O: 2.2 kHz
#
import sys, time
import PyTango
#
try:
    proxyMotor = PyTango.DeviceProxy( "haspp99:10000/p09/motor/d1.65")
except PyTango.DevFailed as e:
    PyTango.Except.print_exception(e)
    sys.exit()

n = 10000.
time_start = time.time()
for i in range(int(n)):
    pos = proxyMotor.Position
time_diff = time.time() - time_start

print( " %d position reads take %g sec" % ( int(n), time_diff))

# from local host:
# 10000 position reads take 2.51724 sec
#
# from remote host:
# 10000 position reads take 4.48184 sec