"Timing" supersedes "Elapsed". But I'll leave the elapsed code intact in case. -------------------------------------------------------------------------------------- Plan: 1. A numbered list of full scripts sent to unchangedScriptToJmol() in top.js, with their EXECUTION times. Between each pair of consecutive scripts will be the numbered (interscript) GAP time. (GAP = NON-JSMOL "NJ"? J is confusing re Javascript. Or PREP time?) EXECUTION time begins when script is sent to JSmol, and ends when it is completed: javascript recordScriptCompletion() GAP time begins when a script completes, and ends when a new script is sent to JSmol. GAP times longer than ??? sec are not included in total and listed in [] (or gray?). They are assumed to be times awaiting a user response. At the top of the list will be Total Execution time + Total Gap Time = Total Time. 2. A Summary list of execution times, sorted longest at top, followed by script numbers. 3. Lists are simply accumulated as text strings during exection (not displayed). 4. Lists are displayed in new windows when a red "T" below JSmol is clicked, which also resets (blanks) the lists. 5. GAP Time prior a display request (click of T) is not recorded. 6. If script execution time is long, need to find which parts are slow. Script command "javascript eltimMidSpt()" records time since start of script execution. 7. If gap time is long, need to find slow parts. eltimMidGap() records time since start of gap in eltimList only (not in eltimSummary). -------------------------------------------------------------------------------------- "elapsed" already in very wide use. Need a unique token easily searched for all related variables/functions. "eltim" for ElapsedTIMe. Query parameter: eltim=1 Variables: eltimActive boolean eltimList eltimSummary eltimSptTot eltimGapTot eltimStart: time a script is sent or completed eltimSptNumber eltimGapNumber Functions: eltimSendSpt() Called by unmodifiedScriptToJmol() just before script is sent. Time since eltimStart is recorded as a Gap for eltimGapNumber eltimGapNumber++ add gap time to eltimGapTot reset eltimStart (start of script execution) Append javascript eltimSptDone() to script. send Spt. eltimSptDone() Called by command appended to script: javascript eltimSptDone() Time since eltimStart is recorded as Script Execution Time for eltimSptNumber reset eltimStart (start of gap) eltimSptNumber++ eltimRecord("s"|"g") records event eltimReport() when red "T" clicked, opens new tab and displays report. eltimWriteTButton() puts red T below JSmol cf. eltimMidSpt() records JSmol time since eltimStart in eltimList only (not eltimSummary) eltimMidGap() records Gap time since eltimStart in eltimList only (not eltimSummary)