We're using the blockchain, so let's tell time with blocks! Roughly every 15 seconds, a miner on the Ethereum network mines a block. So for example, 100 blocks times 15 seconds equals 1,500 seconds which equals 25 minutes.
Some blocks are a little faster, and some blocks are a little slower. So the timing is an estimate.
If you want to run your raffle at specific time of day, then when that time comes, "Use current block" to accept every bid up to that point.
To mine an Ethereum block, miners have to guess a very long number (for example: 15,288,471,551,450,330,000) in accordance with the networks current difficulty rate. They make millions of guesses per second. The miner who guesses the winning number wins the block reward!
This raffle uses the winning number (known as the nonce) from block the raffle is run on to generate the randomness.
We divide the nonce by the difficulty rate to create a new random number. Then we loop through the bidders this amount of times to find the winner! If you are giving away 10 NFTs, the next 9 bidders are chosen as well.