Is there a command in OpenSees to capture the analysis time?
For instance, in Matlab, I can use
tic
...
toc
Thank you very much!
How could I know the analysis time?
Moderators: silvia, selimgunay, Moderators
-
- Posts: 140
- Joined: Sun Oct 03, 2010 11:36 pm
- Location: Hong Kong
How could I know the analysis time?
Research Assistant Professor, The Hong Kong Polytechnic University
guanlin@polyu.edu.hk
guanlin@polyu.edu.hk
-
- Posts: 140
- Joined: Sun Oct 03, 2010 11:36 pm
- Location: Hong Kong
Re: How could I know the analysis time?
No body knows?
Research Assistant Professor, The Hong Kong Polytechnic University
guanlin@polyu.edu.hk
guanlin@polyu.edu.hk
Re: How could I know the analysis time?
If you want to know the time taken to evaluate a section of code you can use the time command
time {
# Enter code here
} $count; If you specify a number here it will run the above code that many times and average result. Default is 1.
Alternatively a better method for bigger projects is to compare the clock times before and after. So could do it like:
set time1 [clock clicks -milliseconds]
# Enter all code here
set time2 [clock clicks -milliseconds]
puts "Elapsed time is [expr $time2-$time1] milliseconds or [expr ($time2-$time1)/1000] seconds"
Hope that helpful
time {
# Enter code here
} $count; If you specify a number here it will run the above code that many times and average result. Default is 1.
Alternatively a better method for bigger projects is to compare the clock times before and after. So could do it like:
set time1 [clock clicks -milliseconds]
# Enter all code here
set time2 [clock clicks -milliseconds]
puts "Elapsed time is [expr $time2-$time1] milliseconds or [expr ($time2-$time1)/1000] seconds"
Hope that helpful
-
- Posts: 140
- Joined: Sun Oct 03, 2010 11:36 pm
- Location: Hong Kong
Re: How could I know the analysis time?
evxjr wrote:
> If you want to know the time taken to evaluate a section of code you can
> use the time command
>
> time {
> # Enter code here
> } $count; If you specify a number here it will run the above code
> that many times and average result. Default is 1.
>
> Alternatively a better method for bigger projects is to compare the clock
> times before and after. So could do it like:
>
> set time1 [clock clicks -milliseconds]
>
> # Enter all code here
>
> set time2 [clock clicks -milliseconds]
>
> puts "Elapsed time is [expr $time2-$time1] milliseconds or [expr
> ($time2-$time1)/1000] seconds"
>
> Hope that helpful
Thank you so much!
> If you want to know the time taken to evaluate a section of code you can
> use the time command
>
> time {
> # Enter code here
> } $count; If you specify a number here it will run the above code
> that many times and average result. Default is 1.
>
> Alternatively a better method for bigger projects is to compare the clock
> times before and after. So could do it like:
>
> set time1 [clock clicks -milliseconds]
>
> # Enter all code here
>
> set time2 [clock clicks -milliseconds]
>
> puts "Elapsed time is [expr $time2-$time1] milliseconds or [expr
> ($time2-$time1)/1000] seconds"
>
> Hope that helpful
Thank you so much!
Research Assistant Professor, The Hong Kong Polytechnic University
guanlin@polyu.edu.hk
guanlin@polyu.edu.hk