Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-stopwatch Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 15:22:31 2021 GMT+0.
• Introduction | What cl-stopwatch is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
=== SOME DOCUMENTATION TO CL-STOPWATCH === Copyright (c) 2012 Robert Smith See LICENSE for license details. == To Time Something == Use WITH-STOPWATCH to time something in milliseconds. For example: > (with-stopwatch > (sleep 5) > 'lol) which results in two values, the first is the result of the computation, the second is the number of milliseconds it took to compute, as shown: > LOL > 5010 If your code isn't simple enough to wrap with a WITH-STOPWATCH, you can use the lower level stopwatch functions. The following example should be self-explanatory. > * (stopwatch-start :race) > ; No value > * (stopwatch-read :race) > 10414 > * (stopwatch-read :race) > 17387 > * (stopwatch-reset :race) > ;; No Value > * (stopwatch-read :race) > 5507 > * (stopwatch-stop :race) > 22128 == To Indicate Progress == Use PROGRESS-TASK to indicate progress to a stream. Example: > (progress-task :sleepy-time "Waiting to wake up" > (sleep 5) > (format t "just 5 more seconds...~%") > (progress-task :snooze "Snoozing a little more" > (sleep 5)) > 'ok-im-awake) which results in the following getting output. > ;;; SLEEPY-TIME: Waiting to wake up... > just 5 more seconds... > ;;; SNOOZE: Snoozing a little more... > ;;; SNOOZE: Done. [4999.0 ms] > ;;; SLEEPY-TIME: Done. [10017.0 ms] > OK-IM-AWAKE Note the nesting, and the increased indentation as a result. There are analogous functions for doing "progress tasks" at a low level like the stopwatch functions. For example: > (progn > (progress-task-start :nap "Taking a nap") > (sleep 3) > (progress-task-done :nap)) which results in: > ;;; NAP: Taking a nap... > ;;; NAP: Done. [3000.0 ms] > ; No value == To Time a Compiled Form == Suppose you have some code you want to benchmark, but you wish to benchmark it compiled. To guarantee it gets compiled, use TIME*. For example: > (time* (progn > (sleep 5) > 'done)) which outputs > Evaluation took: > 5.0000 seconds of real time > 0.000045 seconds of total run time (0.000025 user, 0.000020 system) > 0.00% CPU > 0 bytes consed > > DONE
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-stopwatch system |
Robert Smith
BSD 3-clause. See LICENSE.
Timing and clocking in Common Lisp.
0.1
cl-stopwatch.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-stopwatch.asd file | ||
• The cl-stopwatch/package.lisp file | ||
• The cl-stopwatch/stopwatch.lisp file | ||
• The cl-stopwatch/progress.lisp file | ||
• The cl-stopwatch/time.lisp file |
Next: The cl-stopwatch/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-stopwatch.asd
cl-stopwatch (system)
Next: The cl-stopwatch/stopwatch․lisp file, Previous: The cl-stopwatch․asd file, Up: Lisp files [Contents][Index]
cl-stopwatch (system)
package.lisp
Next: The cl-stopwatch/progress․lisp file, Previous: The cl-stopwatch/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
cl-stopwatch (system)
stopwatch.lisp
Next: The cl-stopwatch/time․lisp file, Previous: The cl-stopwatch/stopwatch․lisp file, Up: Lisp files [Contents][Index]
stopwatch.lisp (file)
cl-stopwatch (system)
progress.lisp
*progress-indent* (special variable)
Previous: The cl-stopwatch/progress․lisp file, Up: Lisp files [Contents][Index]
progress.lisp (file)
cl-stopwatch (system)
time.lisp
time* (macro)
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-stopwatch-asd package | ||
• The cl-stopwatch package |
Next: The cl-stopwatch package, Previous: Packages, Up: Packages [Contents][Index]
cl-stopwatch.asd
Previous: The cl-stopwatch-asd package, Up: Packages [Contents][Index]
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Execute BODY, reporting the task, labeled by the keyword KW and commented with STRING. Report its end time and return the value returned by BODY.
progress.lisp (file)
Freshly compile FORM and time its execution.
time.lisp (file)
Execute BODY, returning its value as well as the value of the watch.
stopwatch.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
End the task designated by the keyword KW and report its completion time to STREAM.
progress.lisp (file)
Start a task designated by the keyword KW, with a comment STRING, and print an indication that the task has started and start a stopwatch. Print everything to STREAM.
progress.lisp (file)
Read a stopwatch designated by KW.
stopwatch.lisp (file)
Resets the stopwatch designated by KW. Equivalent to starting it.
stopwatch.lisp (file)
Start a stopwatch designated by KW.
stopwatch.lisp (file)
Stop the stopwatch designated by KW and return the reading in milliseconds.
stopwatch.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
progress.lisp (file)
stopwatch.lisp (file)
Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Get the time in milliseconds, accurately.
stopwatch.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | F G M P S T W |
---|
Jump to: | F G M P S T W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Jump to: | C P S |
---|