1 |
@c -*-texinfo-*- |
@c -*-texinfo-*- |
2 |
@c This is part of the GNU Emacs Lisp Reference Manual. |
@c This is part of the GNU Emacs Lisp Reference Manual. |
3 |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
4 |
@c See the file elisp.texi for copying conditions. |
@c See the file elisp.texi for copying conditions. |
5 |
@setfilename ../info/compile |
@setfilename ../info/compile |
6 |
@node Byte Compilation, Advising Functions, Loading, Top |
@node Byte Compilation, Advising Functions, Loading, Top |
64 |
(defun silly-loop (n) |
(defun silly-loop (n) |
65 |
"Return time before and after N iterations of a loop." |
"Return time before and after N iterations of a loop." |
66 |
(let ((t1 (current-time-string))) |
(let ((t1 (current-time-string))) |
67 |
(while (> (setq n (1- n)) |
(while (> (setq n (1- n)) |
68 |
0)) |
0)) |
69 |
(list t1 (current-time-string)))) |
(list t1 (current-time-string)))) |
70 |
@result{} silly-loop |
@result{} silly-loop |
530 |
@group |
@group |
531 |
0 constant 1 ; @r{Push 1 onto stack.} |
0 constant 1 ; @r{Push 1 onto stack.} |
532 |
|
|
533 |
1 varref integer ; @r{Get value of @code{integer}} |
1 varref integer ; @r{Get value of @code{integer}} |
534 |
; @r{from the environment} |
; @r{from the environment} |
535 |
; @r{and push the value} |
; @r{and push the value} |
536 |
; @r{onto the stack.} |
; @r{onto the stack.} |
573 |
@group |
@group |
574 |
; @r{Stack now contains:} |
; @r{Stack now contains:} |
575 |
; @minus{} @r{decremented value of @code{integer}} |
; @minus{} @r{decremented value of @code{integer}} |
576 |
; @minus{} @r{@code{factorial}} |
; @minus{} @r{@code{factorial}} |
577 |
; @minus{} @r{value of @code{integer}} |
; @minus{} @r{value of @code{integer}} |
578 |
; @minus{} @r{@code{*}} |
; @minus{} @r{@code{*}} |
579 |
@end group |
@end group |
616 |
(defun silly-loop (n) |
(defun silly-loop (n) |
617 |
"Return time before and after N iterations of a loop." |
"Return time before and after N iterations of a loop." |
618 |
(let ((t1 (current-time-string))) |
(let ((t1 (current-time-string))) |
619 |
(while (> (setq n (1- n)) |
(while (> (setq n (1- n)) |
620 |
0)) |
0)) |
621 |
(list t1 (current-time-string)))) |
(list t1 (current-time-string)))) |
622 |
@result{} silly-loop |
@result{} silly-loop |
717 |
@end group |
@end group |
718 |
|
|
719 |
@group |
@group |
720 |
19 constant current-time-string ; @r{Push} |
19 constant current-time-string ; @r{Push} |
721 |
; @r{@code{current-time-string}} |
; @r{@code{current-time-string}} |
722 |
; @r{onto top of stack.} |
; @r{onto top of stack.} |
723 |
@end group |
@end group |