我有一个程序可以计算消息从一台机器发送到另一台机器所需的时间,但是结果是长格式,我如何将其转换为毫秒
MPI.Init(args);
int myrank = MPI.COMM_WORLD.Rank();
long startTime = System.nanoTime();
if (myrank == 0) {
...
} else {
...
}
long endTime = System.nanoTime();
long duration = endTime - startTime;
结果是:
MPJ Express (0.35) is started in the cluster configuration
Starting process <0> on <Raptor>
Starting process <1> on <Predator>
338198093
received: test :
449582529
Stopping process <0> on <Raptor>
Stopping process <1> on <Predator>
我想把这些转换成更易读的东西