2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-02-15 21:49:26 +00:00
fish-shell/src/timer.h

32 lines
623 B
C
Raw Normal View History

2019-12-19 22:41:53 -06:00
// Prototypes for executing builtin_time function.
#ifndef FISH_TIMER_H
#define FISH_TIMER_H
#include <sys/resource.h>
2019-12-29 14:25:42 -08:00
#include <sys/time.h>
#include <sys/types.h>
#include <chrono>
2019-12-19 22:41:53 -06:00
#include "common.h"
class parser_t;
struct io_streams_t;
cleanup_t push_timer(bool enabled);
2019-12-19 22:41:53 -06:00
struct timer_snapshot_t {
2019-12-29 14:25:42 -08:00
public:
2019-12-19 22:41:53 -06:00
struct rusage cpu_fish;
struct rusage cpu_children;
std::chrono::time_point<std::chrono::steady_clock> wall;
static timer_snapshot_t take();
static wcstring print_delta(timer_snapshot_t t1, timer_snapshot_t t2, bool verbose = false);
2019-12-29 14:25:42 -08:00
private:
2019-12-19 22:41:53 -06:00
timer_snapshot_t() {}
};
#endif