Esempio n. 1
0
/*
 * Make the reported time go faster or slower from now on.
 * Reported times are continuous across this function.
 */
void time_push_rate(long n, long d)
{
    struct trans tr = *trans_top();
    tr.start = now();
    tr.epoch = transform(tr.start);
    tr.factor_num *= n;
    tr.factor_den *= d;
    trans_push(&tr);
}
Esempio n. 2
0
/*
 * Report a given fixed time
 */
void time_push_fixed(time_t fixed)
{
    struct trans tr = *trans_top();
    tr.start = 0;
    tr.epoch = from_time_t(fixed);
    tr.factor_num = 0;
    tr.factor_den = 1;
    trans_push(&tr);
}
Esempio n. 3
0
void trans_rect(int M, int N, int A[N][M], int B[M][N])
{
    trans_top(M, N, A, B);
    trans_bottom(M, N, A, B);
    return;
}
Esempio n. 4
0
static int64_t transform(int64_t t)
{
    const struct trans *tr = trans_top();
    int64_t tt = ((t - tr->start) * tr->factor_num) / tr->factor_den + tr->epoch;
    return tt;
}