System time

hi! what is the easiest way to get the amount of time elapsed while a program a program was closed?

like getting how much time the application has run?

yes- for this I guess getting the ios system clock time would suffice and I could take it from there- how does one do that?