Arduino - bge Framerate

I’m working on a project which uses a photo resistor on an arduino board, connected into blender game engine using pyserial. The sensors output is displayed real time, and it also effects the in game lighting and the scale of an object.

The issue i am having is with the frame rate!! its takes about 5-10 seconds to update the graphics even through the data is coming everysecond. So the real time application is not very real time due to such a huge delay.

Please can anyone advise on improving the framerate???


import GameLogic
import serial
import threading

contr = GameLogic.getCurrentController()
scale=contr.actuators["rot"]
own = contr.getOwner()
scene =GameLogic.getCurrentScene().objects["OBtexter"]

class SerialThread (threading.Thread):

    ser = serial.Serial()
    ser.baudrate = 9600
    ser.port = 'COM7'
    ser.timeout = None
    ser.open()
    x = ser.readline()
    ser.close()
    
    y = ((float(x))/10)
    own.frame = y
    scene.Text = y
    contr.activate(scale)
           
    print y
            
SerialThread().start()

In the frame rate profile display its says Logic is using 99.6% which is giving me a FPS of 0.1,
Please any Clues???, i’m loosing faith in blender