Help of Thread and some Algorithm
I need to write an algorithm (formula) for one of my program, the logic is below.
I have a thread running and it receives a dynamic double value which may range between 1 - 10 or 1 - 20. ( These range are known before i.e we will set the minimum and maximum dynamic value as constant). Now i need a logic like when this dynamic value is 1 (minimum value) my thread should run in minimum speed ( i.e sleep for 1000 milli sec), or if my dynamic value is 10 (20) (maximum value) my thread should run in maximum speed(i.e sleep for 200 milisec). This minimum and maximum speed of thread is also set before in a constant. the dynamic value may change @ any time between the range we have set. Please help me to produce a algorithm or formula for this. Thanks in advance