BulldogLowell:
OP isn't asking for something that crazy/unreasonable.
Javascript's Date.now() returns number of milliseconds since 1970...
Does Javascript return Date.now() with milliseconds on a Yun?
Also, I don't really know how the clocks work but I am not really asking for millisecond since 1970, I am asking for the time to not be rounded to the second. I am asking for a partial second value be returned. This is very standard on Linux.
Here it is from a webserver:
~ >> date
Wed Oct 11 18:01:35 CDT 2017
~ >> date +%s
1507762903
~ >> date +%s.%N
1507762910.309654000
In fact, every Linux I have ever SSL'd into gives the same resolution.
flycast:
Does Javascript return Date.now() with milliseconds on a Yun?
Also, I don't really know how the clocks work but I am not really asking for millisecond since 1970, I am asking for the time to not be rounded to the second. I am asking for a partial second value be returned. This is very standard on Linux.
Here it is from a webserver:
~ >> date
Wed Oct 11 18:01:35 CDT 2017
~ >> date +%s
1507762903
~ >> date +%s.%N
1507762910.309654000
In fact, every Linux I have ever SSL'd into gives the same resolution.
I just can't get the partial second from the Yun.
you need fractions of a second, which the standard Javascript analogy I mentioned provides.
you have a Yun... use an NTP server, no problem...
this issue may be a time library for yun that uses that resolution.
BulldogLowell:
OP isn't asking for something that crazy/unreasonable.
But just because the software will dutifully deliver time in milliseconds doesn't mean the time has been synced properly. That is my point. I wasn't asking what it was needed for, there are many applications. GPS will get you much closer than SNTP if you are hoping for actual millisecond accuracy.
Perhaps my question should have been, exactly how much accuracy do you require?
I would like millisecond resolution. As for accuracy...I am OK with the accuracy being off 1/10th of a second or more. I want as much accuracy as the Yun can muster. I am using the time value as a key in a database. THe database cannot use identical keys. If you enter a new value with an identical key then the database will update the existing record with the new data. So:
I am looking to get a time stamp as close as reasonably possible
A Unique number as a key
Then just use the time to the second and whatever value millis() mod 1000 gives you. Or else cast the result of millis() to an int - in which case it will still never yield the same value in the same second.
Yes. I was aware of that work around and have been thinking about that from the beginning. I could just append a random number on the end of the seconds as well, that's not far from what you propose. I guess my thought is that is a pretty rough workaround for a standard function that Linux has (time) and that the Yun (for whatever reason) doesn't implement. With that said...plus, Yun has the "added advantage" of being able to use the bridge and execute linux functions to get said timestamp.
I think the inability to get fractions od seconds from the Linux processor is a bug. Is there a place where one can do a bug report for the Yun in the hopes that it can get resolved on the next release?
flycast:
Yes. I was aware of that work around and have been thinking about that from the beginning. I could just append a random number on the end of the seconds as well, that's not far from what you propose.
Not really, as there is a small but definite possibility of duplication with a random number.
flycast:
I think the inability to get fractions od seconds from the Linux processor is a bug. Is there a place where one can do a bug report for the Yun in the hopes that it can get resolved on the next release?
It's not a bug. It's an unimplemented feature. Part of the reason Linux can run on so many platforms is that it is modular. You can't expect all features to be present in all kernels/shells. Especially in an embedded release.