Good evening! I'm hoping there is a way to speed up my current code as I need 
it to be just a bit faster to be usable.

At the start of my program is this line

> global_out = usb.util.find_descriptor(intf,custom_match=lambda 
> e:usb.util.endpoint_direction(e.bEndpointAddress)==usb.util.ENDPOINT_OUT)

Then this line actually sends the data

> def sendCommand(content):
> global_out.write(struct.pack("<I", (len(content)+2)))
> global_out.write(content)

The issues is this line

> global_out.write(struct.pack("<I", (len(content)+2)))

Timing it, python says it takes 0.05 seconds to complete this line. I would 
need to get it down to 0.016 seconds in order for my program to function as 
intended. Is there anything I can do to optimize it?

https://gist.github.com/Bluecoreg/1db99d6afcb15aab85760faa16160d05
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to