MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / setTime

Method setTime

pose_graph/ThirdParty/DUtils/Timestamp.cpp:63–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void Timestamp::setTime(const std::string& stime) {
64 std::string::size_type p = stime.find('.');
65 if (p == std::string::npos) {
66 m_secs = atol(stime.c_str());
67 m_usecs = 0;
68 } else {
69 m_secs = atol(stime.substr(0, p).c_str());
70
71 std::string s_usecs = stime.substr(p + 1, 6);
72 m_usecs = atol(stime.substr(p + 1).c_str());
73 m_usecs *= (unsigned long)pow(10.0, double(6 - s_usecs.length()));
74 }
75}
76
77void Timestamp::setTime(double s) {
78 m_secs = (unsigned long)s;

Callers 2

plusMethod · 0.45
minusMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected