Hi Tuan,
1. I'm not sure if you are asking for timed execution or benchmarking execution, so here is an answer to both.
For timed execution use the task manager...
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSA_manage_taskmgr
For benchmarking a loop you will want to use $zh, its the most granular time function in COS, the docs here show it being used for benchmarking the execution of code...
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_vzhorolog
2. You will need to wrap your outer method call in a try catch block so that it will continue to repeat itself even if an error is thrown, something along the lines of...
ClassMethod Start()
{
While 1 {
try {
do ..YourMainMethod()
} catch err {
//log error here
}
}
}
More information can be found here...
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_errors#GCOS_errors_ttc
Sean.
- Log in to post comments