webserver/core/main.cpp: Get REAL-TIME time values #201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Add code to get the real time cycle time and latency, the maximum/minimum/average values would be printed out in the logs as a summary at the end of the OpenPLC running. The following diagram describes the logic.
"|": Beginning of execution of the PLC code
"s": Start of execution of PLC code
"e": End of execution of PLC code
Therefore, the time interval between two "|" symbols is usually 20ms by default(defined in OpenPLC Editor program), while "timeof(e) - timeof(s)" represents the cycle time and "timeof(s) - timeof(|)" represents the latency after sleep.
|s____e_____|s___e____|s_____e______|_____________|
Also a new function RecordCycletimeLatency() was added which uses special_function[4] and special_function[5] to store the cycle time and latency in the running OpenPLC cycle, so in the webpage they can be displayed if necessary.
Thanks my colleagues Alexander Lougovski, Marcelo Tosatti and Wenkang Ji a lot for the initiating, ideas and help.