PETSc application programmers can access the wall clock time directly
with the command
PLogDouble time; ierr = PetscGetTime(&time); CHKERRA(ierr);In addition, as discussed in Section Profiling Application Codes , PETSc can automatically profile user-defined segments of code.