Computers can be programmed to know how long units of time are *in relation to other units of time*, like knowing that 60 seconds is 1 minute. But programming itself isn’t going to make them know how quickly time is passing.
Instead computers have various timing signals in order to operate. These are physical chips which exist just to create a regular signal, usually by a resonating quartz crystal.
Latest Answers