If this is the way to get "timeout" of a system in Java:
timeoutMs = System.currentTimeMillis() + DataLog.getTimeout();
try {
dataLog.thread.join(DataLog.getTimeout());
}
catch (InterruptedException e) {}
if (!dataLog.thread.interrupted()) {
dataLog.thread.interrupt();
}
if (System.currentTimeMillis() > timeoutMs) {
return ("Communication timeout");
} else {
return (dataLog.getResult());
}
}
Is the following code a good way to get the timeout of the system using C#?
Stopwatch sw = new Stopwatch();
sw.Start();
while (true)
{
timeoutMs=DataLog.getTimeout();
}
It is a small part of a big Project so I do not have possibility to see the result in the output..please let me know If it is correct or not!
Thanks in advance...