I know this question may be so simple, I have the following code and it should be converted to C#, but the main problem is that I can not understand what below code is doing exactly!!!!...I've searched but I did not find any thing..I Think may be the timeval structure
and the select function
can be removed with out any consequences!! Am I right?? If no, then How can I convert it to C#??? what is the responsibility of select function
exactly??
thanks in advanced.
void WaitMs(UInt32 milliSeconds)
{
//start of problem
struct timeval t=
{ milliSeconds/1000,
(milliSeconds%1000)*1000
};
Select(0,NULL,NULL,NULL,&t);
UInt32 temp=milliSeconds;
//end of problem
Logger.NewWait(temp);
}
I think the code between start of problem and end of problem is not necessary at all! true??
Time and date values are always transferred by milliseconds value.
For C#:
TimeSpan.FromMilliseconds
DateTime.Parse
as mentioned hereIn C++ there is also a way to do it.
In C#, causing a delay, as
Select
function does in your code, is made byThread.Sleep
call.