Switch, and case with timer
Hello i’ve been trying to write a simple console game, to move the character i use the W and S keys, to move up and down. This is managed by a switch statement, case w:, and case s:.
But i want to implement a timer, if theres no activity in the switch, the user dont press the keys w or s, just press nothing, the program, by itself activates a timer, that brings the user 5 seconds to do something or the game will be closed.
So its that
Any question will be received
I dont share any code, because its that, a switch with letters w and s, and nothing that activates the timer
Reading more forums, apparently I can use <chrono>
to solve that, but I don’t know how to use chrono
Thanks