Fortran 语言中的睡眠
有谁知道 Fortran 中休眠指定毫秒数的方法吗?我不想使用不可移植的系统调用,因此 Fortran 或 C 库固有的任何内容都是首选。
Does anyone know of an way to sleep for a given number of milliseconds in Fortran? I do not want to use non-portable system calls so anything intrinsic to Fortran or C libraries would be preferred.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用Fortran ISO C Binding使用C库sleep以秒为单位进行睡眠:
Using the Fortran ISO C Binding to use the C library sleep to sleep in units of seconds:
您可以使用 Fortran 标准内在函数来执行此操作,无需 C 绑定:
假设可执行文件是 slp:
如果您担心该程序会在午夜左右崩溃,请为此程序添加一个特殊情况:)
You can use Fortran standard intrinsic functions to do this without C binding:
Assuming the executable is slp:
Add a special case to this program if you are worried it will break around midnight :)