Immediate or Cancel option is available whicle placing orders.
I understand my orders will be canceled or partially fulfilled if market does not supply me with enough number of shares.
How many second it will wait, is there a predefined timing for wait?
How is that it functions in background?
Edit:
This is the info, I got from NSE website
IOC - An Immediate or Cancel (IOC) order allows a Trading Member to buy or sell a security as soon as the order is released into the market, failing which the order will be removed from the market. Partial match is possible for the order, and the unmatched portion of the order is cancelled immediately.
I guess EKANSH is right, there is no predefined time.