The Imitation Game
The film is set in England, at three different moments of the 20th century, and tells the story of Alan Turing's life. By mixing different episodes in a non-chronological way, the film gives us an overview of the most important moments of his biography: his conflicted childhood, his career as a worker for the British secret service (I would say either "the British secret service" or "the British intelligence agency"), and the end of his life when* he was condemned to follow an hormonal treatment as a punishment for his "crime" of being homosexual (at that period it was considered a real crime).
One of the most memorable scenes is that in which Turing, after have always been an unsociable and lonely man who didn't treat his partners kindly, is suddenly and unexpectly defended and supported by them in front of his boss, who wanted to fire him out because the machine he was designed didn't yield any results at that time. After that they form a close team and, with the help of his mates Turing is able to decrypt Enigma, the encryption machine used by the Nazis to communicate secretly between them during the Second World War.
Alan Turing killed himself after several months of hormonal treatment, without anyone knowing what he really did.
The phrase "during his last moments" or "in his last moments" exists, but it usually means in the minutes or seconds before a person's death, not the days or months.