You have to press the flag key to start, and it will end automatically.
I did this in a class. My instructor Kim Wang helped me a lot. Thanks to him I did this.