Go to Post You play your best, the refs do their best, and at the end of the day we are FIRST, collectively. - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 13-02-2010, 15:28
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: Time in Milliseconds

Hmm... Well, I'm sure that there's something buried in the WPILib that can do it for you like using the time() function. But, from a VxWorks perspective, you can issue a:

-> sysClkRateGet()

This will tell you the interrupt rate of the system clock. And, sysClkRateSet(100) would set the interrupt rate to 100 Hz (10 ms clock resolution).

With that, tickGet() will return the current clock tick count with subsequent calls allowing you to measure elapsed time to the resolution of the system clock.

And, taskDelay(1) is a delay of 1 clock tick (10 ms at 100 Hz). You can also create watchdog timers that will attach your code to the system clock interrupt service routine and run it at a specified delay. Again, I'm sure that there's something buried in the WPILib that can provide what you're looking for, but I know VxWorks a lot better than I know the WPILib.

HTH,

Mike
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Motor for X Milliseconds DWirth NI LabVIEW 2 10-02-2010 07:54
It's that time of year again!! (No, not The Championship event) Tax Time!! Elgin Clock Chit-Chat 4 10-04-2005 10:59
time? roeperJTD06 OCCRA 1 21-11-2003 18:03
time archiver 2000 3 23-06-2002 22:58


All times are GMT -5. The time now is 13:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi