c# - SerialPort.Write() take a relatively long time to execute -


the function myserialport.write("hello") takes full millisecond execute. have added stopwatch code helps me understand execution time. there way program execute faster? can issue related serial port driver? using usb serial converter cable. baud rate = 115200 parity = none data bits = 8 stop bits = 1 if replace myserialport.write("hello") line empty loop runs 10000 times, executes instantly. therefore if me achieve similar speed execution of myserialport.write("hello") of immense help. in advance.

private void button2_click(object sender, eventargs e) {                stopwatch stopwatch = new stopwatch();     stopwatch.start();                             myserialport.write("hello");                               stopwatch.stop();     timespan ts = stopwatch.elapsed;     textbox2.text = string.format("{0:00}:{1:00}:{2:00}.{3:00}", ts.hours, ts.minutes, ts.seconds, ts.milliseconds); } 


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -