Keysight Technologies Interview Question

How do you design a clock or implement a stopwatch using react.