Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我们有以下方法
private int add(int num_1, int num_2) { return num_1+num+2; }
调用此方法会消耗一个 cpu 周期吗?因为 1 GHz 中有 10 亿个周期。
sleep(5000)不,请考虑导致您的代码暂停 5 秒的函数调用。这将需要超过 1 个时钟周期。
sleep(5000)