So after a run, we've got a file that has a log of the compile run with a time at the beginning of each line.

Let's write a little routine that opens that file, and reads it into a table where the keys are each line of the compiler output and the value is a table with two entries, the line number of the output and the time since the beginning of the compile:

Let's call this file: "lua_checktime_simple.lua".

We just match the line with the pattern (.+)\t(.+) which gets us two items separated by a tab character, and these get returned as a table since we wrap it in braces {}. We read a line into g, then set h = {"g:match("(.+)\t(.+)")}. h[1] will be the time, h[2] will be the compiler output line.

Then we make a new table using the compiler output line as the key with t[h[2]] = {}.

t[h[2]][1] = linenum sets the first entry to the current line numbert[h[2]][2] = h[1] sets the second entry to the time that we got from the match.

I couldn't figure out why the line counts didn't match sometimes I wanted to "diff" the runs to see how the were different.

For instance, the first run A has 3 lines of "Creating ../../../../linux_gcc/bin/x64/Release/mame_mame" where the second run B has only 2 line of "Creating ../../../../linux_gcc/bin/x64/Release/mame_mame".

I thought I'd add some speech so that it'd say "Compile started" and "Compile Completed". Ubuntu's got this spd-say command which makes it easy, just do an os.execute("spd-say 'Open the pod bay doors, hal'")