aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/time.h
blob: 05fc6c651c90ea81495a26bc00e13586228c203f (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
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Time Functions
* (C) 1999-2009 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#ifndef BOTAN_TIME_H__
#define BOTAN_TIME_H__

#include <botan/types.h>
#include <ctime>

namespace Botan {

struct BOTAN_DLL calendar_point
   {
   u32bit year;
   byte month;
   byte day;
   byte hour;
   byte minutes;
   byte seconds;

   calendar_point(u32bit y, byte mon, byte d, byte h, byte min, byte sec) :
      year(y), month(mon), day(d), hour(h), minutes(min), seconds(sec) {}
   };

/*
* Time Access/Conversion Functions
*/
BOTAN_DLL u64bit system_time();

BOTAN_DLL calendar_point calendar_value(u64bit a_time_t);

/**
@return nanoseconds resolution timestamp, unknown epoch
*/
BOTAN_DLL u64bit get_nanoseconds_clock();

}

#endif