Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
LINUX系統程式設計 第二版
by
Robert Love
December 2013
Intermediate to advanced
496 pages
8h 57m
Chinese
GoTop Information, Inc.
Content preview from
LINUX系統程式設計 第二版
時間
|
395
行程時間的一個型別
型別
clock_t
代表時鐘週期(
clock tick
)。它是一個整數型別,通常是一個
long
。根據
介面的不同,
clock_t
可能代表系統的實際計時器頻率(
HZ
)或是
CLOCKS_PER_SEC
。
POSIX
時鐘
本章所討論的系統呼叫中有一些會利用
POSIX
時鐘(這是一個用於實現和表示時間來
源的標準)。型別
clockid_t
用於表示一種特定的
POSIX
時鐘,
Linux
支援其中五種:
CLOCK_REALTIME
全系統的真實時間(壁鐘時間)。設定此時鐘需要特權。
CLOCK_MONOTONIC
一個單調遞增時鐘,任何行程均無法設定它。用於表示自某個未特別指定的起點
(例如,系統開機)之後已過去的時間。
CLOCK_MONOTONIC_RAW
與
CLOCK_MONOTONIC
類似,但是此時鐘無法修正時鐘偏差。也就是,當硬體時鐘比壁
鐘時間快或慢時,若時間是經由此時鐘讀取的,則無法被調整。這是
Linux
特有的
時鐘。
CLOCK_PROCESS_CPUTIME_ID
一個可從處理器取得之高解析度的每行程(
per-process
)時鐘。例如,在
x86
架構
上,此時鐘使用的是時戳計數器(
timestamp counter
,常簡寫為
TSC
)暫存器。
CLOCK_THREAD_CPUTIME_ID
類似於每行程時鐘,但是對一個行程中每個執行緒而言是唯一的。
POSIX
只需要
CLOCK_REALTIME
。因此,儘管
Linux
能夠可靠地提供這五種時鐘,具移植
性的程式碼應該只使用 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
優雅的SciPy|Python科學研究的美學
Juan Nunez-Iglesias, Stéfan van der Walt, Harriet Dashnow
成為卓越程式設計師的38項必修法則
Pete Goodliffe
深入理解運算原理|從簡單的機器到無所不能的程式
Tom Stuart
C++语言导学(原书第2版)
本贾尼 斯特劳斯特鲁普
Publisher Resources
ISBN: 9789862769812