#!/usr/bin/env python import sys, time import PyTango # # this script reads the Counts attribute 10000 times # and measures the total time # # result: local I/O: 5.4 kHz, remote I/O: 2.4 kHz # # try: proxyCounter = PyTango.DeviceProxy( "haspp99:10000/p09/counter/d1.32") except PyTango.DevFailed as e: PyTango.Except.print_exception(e) sys.exit() n = 10000. time_start = time.time() for i in range(int(n)): counts = proxyCounter.Counts time_diff = time.time() - time_start print( " %d counts reads take %g sec" % ( int(n), time_diff)) # from local host: # 10000 counts reads take 1.86422 sec # # from remote host: # 10000 counts reads take 4.1467 sec