如何在 Pari/GP 中实现时间

How to implement time in Pari/GP

我有 Pari/GP 32 位,我想实现任何类型的代码,它可以运行有限的时间,然后如果到那时什么都没有生成则自动停止。这是一个伪代码示例:

command
...
run command
if run time over 3 minutes
automatically interrupt the program and stop running

我知道有一个基本的方法可以做到这一点,只是我从未在 PARI/GP 指南中找到它。有什么帮助吗?谢谢

 alarm(5);for(i=1,10^10,continue)