Skip to content
Snippets Groups Projects
Commit 9b0db769 authored by Martí Morta Garriga's avatar Martí Morta Garriga
Browse files

Added more resolution to getTimeInSeconds function

parent fd4e8bf5
No related branches found
No related tags found
No related merge requests found
......@@ -273,7 +273,7 @@ int main(void)
t2.useRef(true);
t2.set();
cout << " t2: " << t2 << " Is ref used?: " << t2.isRefUsed() << endl << endl;
cout << " t2: " << t2.getTimeInSeconds() << endl;
cout << "\n Example: END\n\n";
......
......@@ -62,7 +62,7 @@ unsigned long CTime::nanoseconds(void)
double CTime::getTimeInSeconds(void)
{
return (double)(this->sec) + this->nsec/1000000000;
return (double)this->sec + (double)this->nsec/1000000000;
}
// IN MILLISECONDS (1234)
......
......@@ -181,11 +181,10 @@ class CTime
/**
* \brief Get time in seconds
*
* This function returns the internal time in seconds with milliseconds
* resolution.
* This function returns the internal time as a double seconds.nanoseconds.
* If this value is very high the resolution after the comma could be changed
*
* \return the internal time in seconds with milliseconds resolution (only
* the first 3 decimal places have real meaning)
* \return the internal time in seconds
*
*/
double getTimeInSeconds(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment