![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
static inline void bintime_addx(struct bintime *bt, uint64_t x);
Static inline funtion. Function for reading the time.
|
static inline void bintime_add(struct bintime *bt, const struct bintime *bt2);
Static inline funtion. Function for reading the time.
|
static inline void bintime_sub(struct bintime *bt, const struct bintime *bt2);
Static inline funtion. Function for reading the time.
|
static inline void bintime2timespec(const struct bintime *bt, struct timespec *ts);
Static inline funtion
|
static inline void timespec2bintime(const struct timespec *ts, struct bintime *bt);
Static inline funtion
|
static inline void bintime2timeval(const struct bintime *bt, struct timeval *tv);
Static inline funtion
|
static inline void timeval2bintime(const struct timeval *tv, struct bintime *bt);
Static inline funtion
|
Interface status: | externallyDefinedApi |
IMPORT_C int adjtime(const struct timeval *, struct timeval *);
The adjtime system call makes small adjustments to the system time (as returned by gettimeofday ) by advancing it the amount specified by the timeval delta .
If delta is negative, the clock is still incremented by the positive of delta until the correction is complete. Thus, the time is always a monotonically increasing function and time correction from an earlier call to adjtime might not have finished when adjtime is called again. In such cases the structure pointed to by olddelta will contain, upon return, the number of microseconds still to be corrected from the earlier call. Otherwise the values will be set to 0
This call may be used by time servers that synchronize the clock.
Examples:
#include <sys/time.h>
#include <stdio.h>
int main()
{
//Fill the input struct with 100 microseconds
const struct timeval delta = {0, 100};
struct timeval olddelta;
int retval;
retval = adjtime (δ, &olddelta;); //Call adjtime
printf("adjtime returned %d",retval);
return 0;
}
Output
adjtime returned 0
|
|
gettimeofday(struct timeval *,struct timezone *)
gettimeofday(struct timeval *,struct timezone *)
Intended Usage: The gettimeofday function obtains the current UTC time, which is...Interface status: | externallyDefinedApi |
IMPORT_C int gettimeofday(struct timeval *, struct timezone *);
The system's notion of the current Greenwich time and the current time zone is obtained with the gettimeofday system call, and set with the settimeofday system call. The time is expressed in seconds and microseconds since midnight (0 hour), January 1, 1970. The resolution of the system clock is hardware dependent, and the time may be updated continuously or in "ticks." If tp or tzp is NULL, the associated time information will not be returned or set.
The structures pointed to by tp and tzp are defined in #include <sys/time.h> as:
struct timeval {
longtv_sec;/* seconds since Jan. 1, 1970 */
longtv_usec;/* and microseconds */
};
struct timezone {
inttz_minuteswest; /* minutes west of Greenwich */
inttz_dsttime;/* type of dst correction */
};
The timezone structure indicates the local time zone (measured in minutes of time westward from Greenwich) and a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year.
Examples:
# 90 "d:/EPOC/release/9.4/common/generic/openenv/core/include/sys/time.dosc" 2
# 91 "d:/EPOC/release/9.4/common/generic/openenv/core/include/sys/time.dosc" 2
int main()
{
struct timeval *tv;
struct timezone *tz;
int i = gettimeofday(tv, tz);
printf("tv: %d, %d", tv->tv_sec, tv->tv_usec);
printf("tz: %d, %d", tz->tz_minuteswest, tz->tz_dsttime);
return 0;
}
Output
tv: 1474660693, -326937770
tz: 7804688, 3
|
|
adjtime(const struct timeval *,struct timeval *)
adjtime(const struct timeval *,struct timeval *)
...clock_gettime(clockid_t,struct timespec *)
clock_gettime(clockid_t,struct timespec *)
The clock_gettime and clock_settime allow the calling process to retrieve or set...ctime(const time_t *)
ctime(const time_t *)
Convert time_t value to string. Converts tim_p to a string containing time and d...Interface status: | externallyDefinedApi |
IMPORT_C int utimes(const char *, const struct timeval *);
The utimes function sets the access and modification times of the file pointed to by the path argument to the value of the times argument. The utimes function allows time specifications accurate to the microsecond.
For utimes , the times argument is an array of timeval structures. The first array member represents the date and time of last access and the second member represents the date and time of last modification. The times in the timeval structure are measured in seconds and microseconds since the Epoch, although rounding toward the nearest second may occur.
If the times argument is a null pointer, the access and modification times of the file are set to the current time.
Examples:
/* Detailed description: Sample usage of utimes system call.
Preconditions: Example.txt file should exist in the working directory
*/
# 150 "d:/EPOC/release/9.4/common/generic/openenv/core/include/sys/time.dosc" 2
# 151 "d:/EPOC/release/9.4/common/generic/openenv/core/include/sys/time.dosc" 2
# 152 "d:/EPOC/release/9.4/common/generic/openenv/core/include/sys/time.dosc" 2
int main()
{
struct timeval Tim[1] ;
Tim[0].tv_sec = 0 ;
Tim[0].tv_usec = 0 ;
if(utimes("Example.txt" , Tim) < 0 )
{
printf("Utimes system call failed") ;
return -1 ;
}
printf("Utimes call succeded") ;
return 0 ;
}
|
|
stat(const char *,struct stat *)
stat(const char *,struct stat *)
Gets the size of a file.