mueller_stopwatch #30
@ -8,7 +8,7 @@
|
|||||||
#include <framework/globalfunctions/timevalOperations.h>
|
#include <framework/globalfunctions/timevalOperations.h>
|
||||||
|
|
||||||
typedef uint32_t millis_t;
|
typedef uint32_t millis_t;
|
||||||
|
|||||||
typedef float seconds_t;
|
typedef double seconds_t;
|
||||||
gaisser
commented
Seconds are converted to double in timevalOperations::toDouble(elapsedTime), this would not fit to the float type. Seconds are converted to double in timevalOperations::toDouble(elapsedTime), this would not fit to the float type.
muellerr
commented
second is double now second is double now
gaisser
commented
I still don't think that those typedefs are a good idea. Maybe we should stick to the types timeval or timespec uses or even use the types C++11 uses in duration Link. I still don't think that those typedefs are a good idea. Maybe we should stick to the types timeval or timespec uses or even use the types C++11 uses in duration [Link](https://www.cplusplus.com/reference/chrono/duration/).
muellerr
commented
Hmmm.. it just makes it a bit mor explicit. I guess you mean for example time_t ? These typedefs were inteded to explicitely be used everywhere uint32_t is used to pass around millisecond values. The new C++ types are a bit more complicated but the clock library will become more powerful soon anyway. I started to play around with the chrono library. Hmmm.. it just makes it a bit mor explicit. I guess you mean for example time_t ?
These typedefs were inteded to explicitely be used everywhere uint32_t is used to pass around millisecond values.
The new C++ types are a bit more complicated but the clock library will become more powerful soon anyway. I started to play around with the chrono library.
Maybe continue using uint32_t for now?
muellerr
commented
instead of writing something like uint32_t lockTimeout, I could write millis_t lockTimeout for example instead of writing something like uint32_t lockTimeout, I could write millis_t lockTimeout for example
|
|||||||
|
|
||||||
class Clock {
|
class Clock {
|
||||||
public:
|
public:
|
||||||
|
Where are does types used?
stopwatch. could also be used somewhere else, is more explicit in my opinion. maybe also use it instead of uint32_t for all milliseconds related stuff?
Hm I think we should stick with timeval and the types defined there. Someday this might be replaced by timespec and uint32_t will be to small anyway.