Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
276 views
in Technique[技术] by (71.8m points)

c++ - how to calculate the accurate time cost for one function?

I want to test latency between two kind of ipc method.

one is zeromq ipc mode, the other is shared memory mode.

and my result tells me, shm cost 0.7 us for each data passing from one process to another, zeromq cost 13us.

I think the number is too large, i suspect it's caused by my timer function, i use gettimeofday method of c++.

Is there any good method to test a functions time cost, and, for a shared memory opertion, is 0.7 us too long? what is the normal range?

thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...