Sat Apr 23, 2016 10:23 am
is there perhaps a Raspi system flag like
Code: Select all
_SYSTEMTIME_UPDATED_ // (1==current time updated, 0==last time read from file)
which one could read from a C/C++ program to be sure about it?
edit:
now from
http://manpages.ubuntu.com/manpages/pre ... eebsd.html I tried this one
(yes I know it's Ubuntu, but could not find something for Jessie...

)
Code: Select all
#include <sys/timex.h>
#include <iostream>
using namespace std;
int main()
{
ntptimeval ntpdummy;
int result = ntp_gettime(&ntpdummy);
if (result == TIME_OK) {
cout << "internet time ok" << endl;
}
else if (result == TIME_ERROR) {
cout << "internet time error" << endl;
}
else {
cout << "something different " << endl;
}
return 0;
}
but even if the Raspi intermediately has been shut down, power off, Wifi removed, power again plugged, restartet:
it always says "internet time ok" .
what can be faulty?
perhaps different proposals about how to check if system time is synced / updated or not?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}