1# zx_ticks_per_second
2
3## NAME
4
5ticks_per_second - Read the number of high-precision timer ticks in a second.
6
7## SYNOPSIS
8
9```
10#include <zircon/syscalls.h>
11
12zx_ticks_t zx_ticks_per_second(void)
13```
14
15## DESCRIPTION
16
17**zx_ticks_per_second**() returns the number of high-precision timer ticks in a
18second.
19
20This can be used together with **zx_ticks_get**() to calculate the amount of
21time elapsed between two subsequent calls to **zx_ticks_get**().
22
23This value can vary from boot to boot of a given system. Once booted,
24this value is guaranteed not to change.
25
26## RIGHTS
27
28TODO(ZX-2399)
29
30## RETURN VALUE
31
32**zx_ticks_per_second**() returns the number of high-precision timer ticks in a
33second.
34
35## ERRORS
36
37**zx_ticks_per_second**() does not report any error conditions.
38
39## EXAMPLES
40
41```
42zx_ticks_t ticks_per_second = zx_ticks_per_second();
43zx_ticks_t ticks_start = zx_ticks_get();
44
45// do some more work
46
47zx_ticks_t ticks_end = zx_ticks_get();
48double elapsed_seconds = (ticks_end - ticks_start) / (double)ticks_per_second;
49
50```
51
52## SEE ALSO
53
54[ticks_get](ticks_get.md)
55