A.48 library(statistics): Get information about resource usage
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(statistics): Get information about resource usage
          • statistics/0
          • statistics/1
          • thread_statistics/2
          • time/1
          • call_time/2
          • call_time/3
          • profile/1
          • profile/2
          • show_profile/1
          • profile_data/1
          • profile_procedure_data/2
    • Packages
Availability::- use_module(library(statistics)).(can be autoloaded)
Source[nondet]time(:Goal)
Execute Goal, reporting statistics to the user. If Goal succeeds non-deterministically, retrying reports the statistics for providing the next answer.

Statistics are retrieved using thread_statistics/3 on the calling thread. Note that not all systems support thread-specific CPU time. Notable, this is lacking on MacOS X.

See also
- statistics/2 for obtaining statistics in your program and understanding the reported values.
- call_time/2, call_time/3 to obtain the timing in a dict.
bug
Inference statistics are often a few off.