free hit counter

Wednesday, December 22, 2010

whole internet on your TV

I loved the Intel billboard I saw on the freeway back in early November:

Get the whole internet on your TV



After talking with SmartTV box makers for the past two years and seeing them limit customers to walled garden applications I'm really excited that someone else at Intel sees things like I do: no company can expect to keep up with the pace of Internet development, and the variety that it gives to users.

Now I think we're starting to see the rest of that PR push by Intel with Wall Stree Journal articles and more:
http://online.wsj.com/article/BT-CO-20101221-710711.html

Labels:

Wednesday, December 08, 2010

precision timers

Trying to timestamp when USB data is received and a standard QTimer was terrible. It turns out under Windows you can get something more accurate:
QueryPerformanceCounter() solves the issue.

Sample code below for getting out the timer tick in milliseconds. I should really put this into a nice little object, but no time right now!


...
QueryPerformanceFrequency(&_TICKS_TO_MSEC);
qDebug() << _TICKS_TO_MSEC.QuadPart;
_TICKS_TO_MSEC.QuadPart= _TICKS_TO_MSEC.QuadPart / 1000;
qDebug() << _TICKS_TO_MSEC.QuadPart;
QueryPerformanceCounter(&_resetTime);
getTimeMs(); //!!!
getTimeMs(); //!!!
QTimer::singleShot(1000, this, SLOT(getTimeMs()));
...
double getTimeMs()
{
double result;

LARGE_INTEGER ticks;
QueryPerformanceCounter(&ticks);

ticks.QuadPart= ticks.QuadPart - _resetTime.QuadPart;
result= ((double)ticks.QuadPart) / ((double)_TICKS_TO_MSEC.QuadPart) ;

qDebug() << "tstamp: " << result;

return result;
}


Returns these results, showing that QTimer is accurate within 10ms.

2337968
2337
tstamp: 0.0012837
tstamp: 0.132221
tstamp: 1010.78

Labels: