summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorToni G <toni.giorgino@isib.cnr.it>2013-08-21 23:26:04 +0200
committerToni G <toni.giorgino@isib.cnr.it>2013-08-21 23:26:04 +0200
commit39fc1bb0a85e60b8e6bb6a194a680327c9d12165 (patch)
tree70109f146c747d49c2782aad729cf33a241a140c /man
parent4a4673df6c4c4fc56e301c65a39fe2c90660b297 (diff)
downloadlibfaketime-39fc1bb0a85e60b8e6bb6a194a680327c9d12165.tar.gz
attempt at global relative
Diffstat (limited to 'man')
-rw-r--r--man/faketime.18
1 files changed, 5 insertions, 3 deletions
diff --git a/man/faketime.1 b/man/faketime.1
index 0d9323b..c88946b 100644
--- a/man/faketime.1
+++ b/man/faketime.1
@@ -33,7 +33,9 @@ faketime '2008-12-24 08:15:42' /bin/date
faketime -f '+2,5y x10,0' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
faketime -f '+2,5y x0,50' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
faketime -f '+2,5y i2,0' /bin/bash -c 'while true; do date ; sleep 1 ; done'
-In this single case all spawned processes will use the same global clock without restaring it at the start of each process.
+faketime -f '^2008-12-24 08:15:42' /bin/bash -c 'date; while true; do date; sleep 1 ; done'
+In the two latter cases all spawned processes will use the same global clock without
+restaring it at the start of each process.
(Please note that it depends on your locale settings whether . or , has to be used for fractional offsets)
.fi
@@ -49,8 +51,8 @@ If you want to specify an absolute point in time, exactly this format must be us
Relative time offset: \fB"[+/-]123[m/h/d/y]\fR, e.g. "+60m", "+2y"
This is the most often used format and specifies the faked time relatively to the current real time. The first character of the format string \fBmust\fR be a + or a -. The numeric value by default represents seconds, but the modifiers m, h, d, and y can be used to specify minutes, hours, days, or years, respectively. For example, "-2y" means "two years ago". Fractional time offsets can be used, e.g. "+2,5y", which means "two and a half years in the future". Please note that the fraction delimiter depends on your locale settings, so if "+2,5y" does not work, you might want to try "+2.5y".
.TP
-Start-at timestamps: \fB"@YYYY-MM-DD hh:mm:ss"\fR
-The wall clock will start counting at the given timestamp for the program. This can be used for specifying absolute timestamps without freezing the clock.
+Start-at timestamps: \fB"@YYYY-MM-DD hh:mm:ss"\fR and \fB"^YYYY-MM-DD hh:mm:ss"\fR
+The wall clock will start counting at the given timestamp for the program. This can be used for specifying absolute timestamps without freezing the clock. With the @ (at) syntax, each new subprocess will start at the specified time. With ^ (caret), subprocesses will share a global starting time.
.SH ADVANCED USAGE
When using relative time offsets or start-at timestamps (see ADVANCED TIMESTAMP FORMAT above and option \fB\-f\fR), the clock speed can be adjusted, i.e. time may run faster or slower for the executed program. For example, \fB"+5y x10"\fR will set the faked time 5 years into the future and make the time pass 10 times as fast (one real second equals 10 seconds measured by the program). Similarly, the flow of time can be slowed, e.g. using \fB"-7d x0,2"\fR, which will set the faked time 7 days in the past and set the clock speed to 20 percent, i.e. it takes five real world seconds for one second measured by the program. Again, depending on your locale, either "x2.0" or "x2,0" may be required regarding the delimiter. You can also make faketime to advance the reported time by a preset interval upon each time() call independently from the system's time using \fB"-7d i2,0"\fR, where
\fB"i"\fR is followed by the increase interval in seconds.