Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 53 lines (47 sloc) 1.72 kb
b989030 @bbulkow Added correct copyright notice
bbulkow authored
1 /*
b2e413e @gooding470 ACT version 3.0 - new config scheme specifies record size and write r…
gooding470 authored
2 * clock.h
b989030 @bbulkow Added correct copyright notice
bbulkow authored
3 *
b2e413e @gooding470 ACT version 3.0 - new config scheme specifies record size and write r…
gooding470 authored
4 * Copyright (c) 2008-2014 Aerospike, Inc. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
b989030 @bbulkow Added correct copyright notice
bbulkow authored
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
b2e413e @gooding470 ACT version 3.0 - new config scheme specifies record size and write r…
gooding470 authored
24
b989030 @bbulkow Added correct copyright notice
bbulkow authored
25 #pragma once
26
27 #include <stdint.h>
b2e413e @gooding470 ACT version 3.0 - new config scheme specifies record size and write r…
gooding470 authored
28 #include <time.h>
b989030 @bbulkow Added correct copyright notice
bbulkow authored
29
639122d @gooding470 AER-2653 - improved histograms for ACT - histogram data are now based…
gooding470 authored
30 static inline uint64_t
31 cf_getms()
b989030 @bbulkow Added correct copyright notice
bbulkow authored
32 {
639122d @gooding470 AER-2653 - improved histograms for ACT - histogram data are now based…
gooding470 authored
33 struct timespec ts;
34 clock_gettime(CLOCK_MONOTONIC, &ts);
35 return ((uint64_t)ts.tv_nsec / 1000000) + ((uint64_t)ts.tv_sec * 1000);
b989030 @bbulkow Added correct copyright notice
bbulkow authored
36 }
37
639122d @gooding470 AER-2653 - improved histograms for ACT - histogram data are now based…
gooding470 authored
38 static inline uint64_t
39 cf_getus()
b989030 @bbulkow Added correct copyright notice
bbulkow authored
40 {
639122d @gooding470 AER-2653 - improved histograms for ACT - histogram data are now based…
gooding470 authored
41 struct timespec ts;
42 clock_gettime(CLOCK_MONOTONIC, &ts);
43 return ((uint64_t)ts.tv_nsec / 1000) + ((uint64_t)ts.tv_sec * 1000000);
b989030 @bbulkow Added correct copyright notice
bbulkow authored
44 }
45
639122d @gooding470 AER-2653 - improved histograms for ACT - histogram data are now based…
gooding470 authored
46 static inline uint64_t
47 cf_getns()
b989030 @bbulkow Added correct copyright notice
bbulkow authored
48 {
639122d @gooding470 AER-2653 - improved histograms for ACT - histogram data are now based…
gooding470 authored
49 struct timespec ts;
50 clock_gettime(CLOCK_MONOTONIC, &ts);
51 return (uint64_t)ts.tv_nsec + ((uint64_t)ts.tv_sec * 1000000000);
b989030 @bbulkow Added correct copyright notice
bbulkow authored
52 }
Something went wrong with that request. Please try again.