!
!   TITLE:  profile.mac (MANAGEMENT)
!
!
! Used for profiling macros for speed.
!
! This macro is used to measure the time duration it takes ANSYS to do
! a block of commands.  It is inserted at desired locations througout
! the macro to be profiled.
!
! The first usage of this macro should be without an argument to get
! things initialized.  Each subsequent call of this macro should include
! a numeric argument.  The numeric argument is used to track the call
! number within the profiled macro to the output written to "profile.out".
! Generally the numeric argument supplied should increase with each
! call, but it is arbitrary.
!
!
! profile
! profile,num
!
!   where num = An integer value (I2) or floating point (F5.1). 
!
*get,prkey_,active,0,prkey
/nopr


*if,arg1,ne,0,then

*get,stopc_,active,0,time,cpu
sec_=stopc_-_startc_

/out,profile,out,,append
*vwrite,arg1,sec_*1000.0
(F5.1,': ',F10.3,' msec')
/out

*else

/out,profile,out
*msg
Times from profile.mac:
*msg

/out

*endif

*get,_startc_,active,0,time,cpu


*if,prkey_,eq,1,then
    /go
*endif