On Sat, Dec 4, 2010 at 1:43 PM, Don Stanley <[email protected]> wrote:
> I need to monitor and control the rate of a motor for a fixed RPM.
> As suggested by John K, I'm thinking to use the computer clock as
> a time base.
>
> Apparently I have looked in all the wrong places to find how to
> access the computer time.

One way is with clock_gettime() from the librt realtime library (link
with -l rt)

#include <stdio.h>
#include <time.h>

int main()
{
   struct timespec ts;
   if  (clock_gettime(CLOCK_REALTIME, &ts) != 0) {perror("gettime
error:"); } else { printf("%ld %ld\n", ts.tv_sec, ts.tv_nsec); };
}

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to