rossmann-engineering / EasyModbusTCP.NET

Modbus TCP, Modbus UDP and Modbus RTU client/server library for .NET implementations
947 stars 412 forks source link

Feature/delay method #71

Closed HowardWhile closed 1 year ago

HowardWhile commented 3 years ago

Hi rossmann-engineering

I provide a delay method Can reduce the RTT (round-trip time) of communication

I am use

SpinWait sw_delay = new SpinWait();
sw_delay.SpinOnce(); 

to replace

System.Threading.Thread.Sleep(1);  

After modification, the average RTT on serial-port communication is reduced from 30 to 16(millisecond)

Hope you like it.