Main MRPT website > C++ reference for MRPT 1.9.9
test.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 /**
11  * times
12  * Prints current time instances in UTC format
13  */
14 
15 #include <mrpt/system/datetime.h>
16 #include <iostream>
17 
18 using namespace mrpt;
19 using namespace mrpt::system;
20 
21 // ------------------------------------------------------
22 // TestTypes
23 // ------------------------------------------------------
24 void TestTimes()
25 {
26  TTimeStamp t;
27  for (size_t i = 0; i < 20; i++)
28  {
30  std::cout << mrpt::system::dateTimeToString(t) << std::endl;
31  }
32 }
33 
34 // ------------------------------------------------------
35 // MAIN
36 // ------------------------------------------------------
37 int main()
38 {
39  try
40  {
41  TestTimes();
42 
43  return 0;
44  }
45  catch (std::exception& e)
46  {
47  std::cout << "MRPT exception caught: " << e.what() << std::endl;
48  return -1;
49  }
50  catch (...)
51  {
52  printf("Untyped exception!!");
53  return -1;
54  }
55 }
TestTimes
void TestTimes()
Definition: vision_stereo_rectify/test.cpp:24
mrpt::system::dateTimeToString
std::string dateTimeToString(const mrpt::system::TTimeStamp t)
Convert a timestamp into this textual form (UTC time): YEAR/MONTH/DAY,HH:MM:SS.MMM.
Definition: datetime.cpp:248
t
GLdouble GLdouble t
Definition: glext.h:3689
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::system::TTimeStamp
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
Definition: datetime.h:31
main
int main()
Definition: vision_stereo_rectify/test.cpp:78
mrpt::system::getCurrentTime
mrpt::system::TTimeStamp getCurrentTime()
Returns the current (UTC) system time.
Definition: datetime.cpp:74
mrpt::system
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Definition: math_frwds.h:25
datetime.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST