How to set the time for particular funtion?

  • Thread starter Thread starter paresh
  • Start date Start date
P

paresh

Hi,

Could any one tell me how to set the particular time for my function either
using Timer(not sure if it works only in Form) or Thread or any other method?
I want to kill that function if id doesn't return in specific time say 1
minute.

Thanks.
 
Without knowing how that function is written or what language you're using
it's rather difficult to know what to recommend.

In general, if you are using VBA or VB you are using a single threaded
environment and you are best off writing your function, whatever it is, to
handle the timing for you. That means a loop, possibly with a limit counter
or a Sleep statement that when exceeded leads to a code fork that exits the
function.

However, that's general and not specific since no one but you knows what
your function is or how it's constricted or what it's trying to do.
 
Back
Top