Open System Services Programmer's Guide

5 Managing Time
This section describes the time-management features that are common to both UNIX and the OSS
API and those that are unique to the OSS API.
You can use OSS functions and Guardian procedures to query the system clock, obtain process
times, and set process timers.
This section discusses the following topics:
ContentTopic
Summary of the differences between OSS and UNIX time
management.
“Common and Unique Characteristics” (page 166)
The objects on which you can use time-management
functions and procedures.
“Process Attributes” (page 113)
How to obtain and format the system date and time.“Querying the System Clock” (page 167)
How to obtain process times.“Querying Process Times” (page 168)
How to use the SETLOOPTIMER procedure in an OSS
program.
“Limiting Processor Time Use” (page 168)
List of each OSS time-management function with notes
about the OSS implementation and its use on Guardian
objects.
“OSS Time-Management Functions” (page 169)
List of each Guardian time-management procedure with
notes about its use on OSS objects.
“Guardian Time-Management Procedures” (page 171)
Common and Unique Characteristics
OSS time management is the same as UNIX time management, except that you cannot set or alter
the system clock with an OSS function.
Features Common to UNIX and OSS Time Management
The OSS API enables you to:
Obtain the system time with the time() function
Obtain process times with the clock() and times() functions
Set alarms with the alarm() and ualarm() functions
The OSS API also enables you to format the time and perform time calculations with the following
functions:
SummaryFunction
Converts the date and time to a string.asctime()
Converts time units.ctime()
Computes the difference between two calendar time values.difftime()
Converts a time value to broken-down Coordinated Universal Time (UTC) time.gmtime()
Converts a time value to broken-down local time.localtime()
Converts a broken-down time into time since the Epoch (00:00:00 UTC January
1, 1970 A.D.).
mktime()
Converts a date and time to a string.strftime()
166 Managing Time