russ wrote:It returns a huge long stanza of text you'd need to parse to get the one line where it has a time. It just isn't doable.
As I've just discovered, the output of consoleProfiler.report doesn't seem to return that long of a text if you assign the correct command to a variable and print the output using game.sayAll. Surprisingly, using a few basic variable assignments I was able to return the one line that I am interested in, that is the line which returns the number of frames and the elapsed time, in seconds. The rest of the text from consoleProfiler.report isn't returned, surprisingly enough.
Using the Debugger, one would at first enable the consoleProfiler class of commands by typing "consoleProfiler.enable 1".
Once that's done, we type "consoleProfiler.stopGlobalTimer" in the console. This starts our global timer.
To end the global timer, we type "consoleProfiler.stopGlobalTimer". The elapsed time between when we typed the previous command (startGlobalTimer) and when we typed the current command (stopGlobalTimer) is what is interesting to us. That elapsed time is saved by the "consoleProfiler.report" command, which we then type. Doing so returns a long list of integers such as the number of frames, FPS and the number of seconds elapsed between startGlobalTimer and stopGlobalTimer. This last parameter is what we want.
To get a summary of the long text returned by the report command, we can create a new variable, say var v_report, and assign it to the report command, like this: consoleProfiler.report -> v_report. Then, to see the summarized text (number of frames + elapsed time, in seconds), we could type in console: game.sayAll v_report. This will return the information we want (number of frames and the elapsed time), as you can see in the two images above.
As mentionned I haven't tested this outside of the Debugger, so I do not know if it works in online games. It probably doesn't, but this could be useful for players that want to find a way to keep track of the elapsed time, and possibly (and this is where all the fun is), create custom scripts to trigger events depending on the elapsed time.