Time consumed in analysis

If you have a script you think might be useful to others post it
here. Hopefully we will be able to get the most useful of these incorporated in the manuals.

Moderators: silvia, selimgunay, Moderators

Post Reply
mrathore
Posts: 18
Joined: Thu May 29, 2008 2:38 am
Location: Mumbai
Contact:

Time consumed in analysis

Post by mrathore »

Hello,
I made a very very small script that might be useful to some of OpenSees users. Earlier I had to use a stopwatch to see what is the time required for a particular analysis and so I used following script.

Place the following line at the start of master tcl input file (say all.tcl)

Code: Select all

set startTime [clock clicks -milliseconds]
Then call all the input tcl files (say geom.tcl, eigen.tcl, gravity.tcl, dynamic.tcl, etc.) here.
And finally at the end put following lines of same master file (i.e. all.tcl)

Code: Select all

set finishTime [clock clicks -milliseconds];
set timeSeconds  [expr ($finishTime-$startTime)/1000];
set timeMinutes  [expr ($timeSeconds/60)];
set timeHours    [expr ($timeSeconds/3600)];
set timeMinutes  [expr ($timeMinutes - $timeHours*60)];
set timeSeconds  [expr ($timeSeconds - $timeMinutes*60 - $timeHours*3600)];
puts "\n----------------------------------";
#puts "\a";
puts "TOTAL TIME TAKEN $timeHours:$timeMinutes:$timeSeconds";
The above script will display time consumed by the analysis in format HH:MM:SS. If you want to hear an audio tone at the end of analysis then remove # from second last line.

Thanks.
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

you can also do stuff like:

set thisStartTime [clock format [clock seconds]]
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
Post Reply