Skip to content

Tip #16: Automatisch Zeit messen

Hin und wieder laufen Programme recht lange und im Nachhinein fällt mir ein, dass ich gern gewusst hätte, wie lange das Programm gelaufen ist. Jetzt könnte ich das Programm nochmal starten und entsprechende Befehle mitgeben. Viel einfacher ist jedoch die Variable REPORTTIME in der zsh. Dieser wird eine natürliche Zahl übergeben, welcher als Sekunden interpretiert wird. Wenn ein Programm länger läuft als der Wert, der in REPORTTIME gesetzt ist, dann gibt die Zsh automatisch, Statistiken zur Zeit aus:

jens@jurkki: ~> export REPORTTIME=2
jens@jurkki: ~> kommando --was --lange --dauert
12,23s user 28,76s system 98% cpu 23,812 total

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
BBCode format allowed
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Form options
cronjob