5006c509356b43c8c819f76bca4128f166dac81d
[senf.git] / Utils / MicroTime.cc
1 // $Id$
2 //
3 // Copyright (C) 2006 
4
5 // Definition of non-inline non-template functions
6
7 #include "MicroTime.hh"
8 //#include "MicroTime.ih"
9
10 // Custom includes
11 #include <sys/time.h>
12 #include <time.h>
13 #include <errno.h>
14
15 #include "Utils/Exception.hh"
16
17 //#include "MicroTime.mpp"
18 #define prefix_
19 ///////////////////////////////cc.p////////////////////////////////////////
20
21 prefix_ senf::MicroTime senf::now()
22 {
23     struct timeval tv;
24     if (gettimeofday(&tv,0) < 0)
25         throw SystemException(errno);
26     return 1000000*MicroTime(tv.tv_sec) + tv.tv_usec;
27 }
28
29
30 ///////////////////////////////cc.e////////////////////////////////////////
31 #undef prefix_
32 //#include "MicroTime.mpp"
33
34 \f
35 // Local Variables:
36 // mode: c++
37 // End: