Я уже вся заждалась, измаялась и даже немного всплакнула.
?? ??? ????? ???????? ? ???? ???? ??????. ??????????? ??? ? ???, ??? ????? ??????????, ?????????? ? ???????? ????? TCP/IP ??????????, ?????????? ?? ??, ??? ????????? ??????? ?? ???? ???????? ????? ????????, ? ???, ??????, ?????????? ??????? ????? ????? 300 ??????????? – ??????????. ???????, ???? ?? ????, ??? ?????????? ???????? ??? ?? ? ??? ?? ??????, - ????????? ??? ??????? ???????? ???? ?????? ??????????????. ??? ??????? ??????? ???????, ??? ?? ?????????? ???? ? ???????? ???????? ?? ?????? ????????? ? ????? «????? ???????????» (? ??????????, ??? ??? ??? ????????).
????? ????, ????????? ????????? ??????? ??????. ?????? ?? ???, ??????????? ????????, ???????? ??????? ??????????????. ??? ??????? ????????????? ??????????, ??????? ???????? ???????? ?????????? ????????, ??????? ???????? ???????? ??? ???:
?????? ???????? ??????? ????? ?????? ? ???????:
message->timestamp = (DWORD)QueryPerformanceCounter(); send(message);
?????? ?????????? ???? ????? ??? ?????? ?????? ? ???????? - ??? ???????:
message->timestamp += (DWORD)QueryPerformanceCounter(); … message->timestamp -= (DWORD)QueryPerformanceCounter(); send(message);
?????? ?????????? ??????? ????? ? ?????????? ? ??????:
DWORD delta = (DWORD)QueryPerformanceCounter() - message->timestamp; double latency = (double)delta / QueryPerformanceFrequency();
?????????? ?????? ?????? ?????, ????????? ????? ????????? ? ??????? ??????, ?? ??????? ??????? ?? ????????? ?????? ????????. ???? ? ?????????????? ??????? 4-? ???? ???????? ???? ? ?? ????? ??????, ?? ???????? ??? ??????? ???, ???? DWORD ????????? ???????? ???????? ???????, ??? ???????????? ???????? ??????.
??????? ?????? ????????? ? ???, ??? ??????? ??????? ???????? ?????????? ????????? ????????? ?? ??????? ?? ??????? ? ???????. ?????????, ??? ??? ?????? ?????????? ?????????? ??????? ??????? ???????? ?????????? ???? ?????? ?? ??? ???, ???? ?????????? ?? ?????? ? ?????? ???????? ?? ???????????? ?????????.
Cross-posted from blog.not-a-kernel-guy.com.