Wait until multiple of 1/2 second

I'd like either (1) have a thread activate every 1/2 second, or (2) have a thread wait until the next multiple of 1/2 second before issuing a command to poll a device. (I already have the .h and .lib file to poll the device.)