Online Timing Slack Measurement and its Application in Field-Programmable Gate Arrays