Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement deferred operation in Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to achieve deferred operation in Linux, I believe that many inexperienced people do not know what to do. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

1. The header function for timing in the kernel is # include

2. The Hz symbol indicates the number of clock ticks produced per second, that is, the time interrupt generated by 1 second.

3 、 # include

Volatile unsigned long jiffies uses this variable to measure the change of time.

4. Int time_after (unsigned long a, unsigned long b)

Int time_before (unsigned long a, unsigned long b)

These Boolean expressions compare jiffies values in a safe way, regardless of timer overflow.

5. The numerical conversion between the time represented by jiffies and other representation methods:

Struct timeval {time_t tv_sec; / * seconds * / suseconds_t tv_usec; / * microseconds * /}; struct timespec {long int tv_sec; long int tv_nsec;}

Header files that use this structure are commonly used in # include:

Int gettimeofday (struct timeval * tv, struct timezone * tz); after reading the above, have you mastered how to postpone the operation in Linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report