summaryrefslogtreecommitdiff
path: root/include/git2/sys/time.h
blob: e4f87e6e1d305ea5fbb867b5170af40adc3a8e38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_git_time_h__
#define INCLUDE_git_time_h__

#include "git2/common.h"

GIT_BEGIN_DECL

/**
 * Return a monotonic time value, useful for measuring running time
 * and setting up timeouts.
 *
 * The returned value is an arbitrary point in time -- it can only be
 * used when comparing it to another `git_time_monotonic` call.
 *
 * The time is returned in seconds, with a decimal fraction that differs
 * on accuracy based on the underlying system, but should be least
 * accurate to Nanoseconds.
 *
 * This function cannot fail.
 */
GIT_EXTERN(double) git_time_monotonic(void);

GIT_END_DECL
#endif