Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to pass a handler to another form Pin
Richard MacCutchan1-Sep-10 23:23
mveRichard MacCutchan1-Sep-10 23:23 
GeneralRe: how to pass a handler to another form Pin
zhiyuan162-Sep-10 3:34
zhiyuan162-Sep-10 3:34 
GeneralRe: how to pass a handler to another form Pin
Richard MacCutchan2-Sep-10 4:09
mveRichard MacCutchan2-Sep-10 4:09 
GeneralRe: how to pass a handler to another form Pin
DaveyM691-Sep-10 23:58
professionalDaveyM691-Sep-10 23:58 
QuestionHow do i Test Automate Datagrid View Pin
arun_pk1-Sep-10 20:01
arun_pk1-Sep-10 20:01 
AnswerRe: How do i Test Automate Datagrid View Pin
Henry Minute2-Sep-10 3:46
Henry Minute2-Sep-10 3:46 
QuestionInplement a precise timer Pin
cateyes991-Sep-10 13:50
cateyes991-Sep-10 13:50 
AnswerRe: Inplement a precise timer Pin
Luc Pattyn1-Sep-10 14:32
sitebuilderLuc Pattyn1-Sep-10 14:32 
I'm not aware of any explicit support for a due time.

For a 1-second resolution I would just pick some timer (Windows.Forms/Threading/Timers depending on circumstances) and use DateTime and TimeSpan classes to calculate and set the delay.

For a finer resolution, I'd start with the above, then probably execute some polling loop within the final second, including a Thread.Sleep(ms) with a number of milliseconds fitting the resolution (assuming >= 50)

Whatever you do, keep in mind things could go wrong in several ways:
- your PC might get very busy while calculating and setting the due time, resulting in a late call;
- your PC might get very busy at the due time, so the requested action may actually run somewhat later;
- your PC might be switched off or crash in the mean time.

Depending on your requirements a Windows scheduled task may or may not be a better option.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Inplement a precise timer Pin
cateyes992-Sep-10 12:19
cateyes992-Sep-10 12:19 
AnswerRe: Inplement a precise timer Pin
Ritesh Ramesh1-Sep-10 15:22
Ritesh Ramesh1-Sep-10 15:22 
AnswerRe: Inplement a precise timer Pin
PIEBALDconsult1-Sep-10 15:28
mvePIEBALDconsult1-Sep-10 15:28 
GeneralRe: Inplement a precise timer Pin
Luc Pattyn1-Sep-10 15:52
sitebuilderLuc Pattyn1-Sep-10 15:52 
GeneralRe: Inplement a precise timer Pin
PIEBALDconsult1-Sep-10 16:47
mvePIEBALDconsult1-Sep-10 16:47 
JokeRe: Inplement a precise timer Pin
Keith Barrow1-Sep-10 21:04
professionalKeith Barrow1-Sep-10 21:04 
GeneralRe: Inplement a precise timer Pin
OriginalGriff1-Sep-10 21:45
mveOriginalGriff1-Sep-10 21:45 
AnswerRe: Inplement a precise timer Pin
Garth J Lancaster1-Sep-10 17:45
professionalGarth J Lancaster1-Sep-10 17:45 
GeneralRe: Inplement a precise timer Pin
cateyes992-Sep-10 12:28
cateyes992-Sep-10 12:28 
AnswerRe: Inplement a precise timer Pin
Pete O'Hanlon1-Sep-10 22:30
mvePete O'Hanlon1-Sep-10 22:30 
GeneralRe: Inplement a precise timer Pin
Tom Foswick2-Sep-10 5:55
Tom Foswick2-Sep-10 5:55 
GeneralRe: Inplement a precise timer Pin
cateyes992-Sep-10 11:50
cateyes992-Sep-10 11:50 
GeneralRe: Inplement a precise timer Pin
cateyes992-Sep-10 11:48
cateyes992-Sep-10 11:48 
AnswerRe: Inplement a precise timer Pin
roman4002-Sep-10 1:31
roman4002-Sep-10 1:31 
GeneralRe: Inplement a precise timer Pin
cateyes992-Sep-10 11:51
cateyes992-Sep-10 11:51 
AnswerRe: Inplement a precise timer Pin
englebart2-Sep-10 2:07
professionalenglebart2-Sep-10 2:07 
GeneralRe: Inplement a precise timer [modified] Pin
cateyes992-Sep-10 11:54
cateyes992-Sep-10 11:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.