---
name: "bson_clock"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.4.2-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_clock"
---

# bson\_clock(3)

BSON Clock Abstraction

## NAME

System\_Clock - BSON Clock Abstraction

## SYNOPSIS

```
int64_t bson_get_monotonic_time (void);
int     bson_gettimeofday       (struct timeval  *tv,
#if defined(__SUNPRO_C)
                                 void            *tz);
#else
                                 struct timezone *tz);
```

## DESCRIPTION

The clock abstraction in Libbson provides a cross‐platform way to handle timeouts within the BSON library. It abstracts the differences in implementations of **gettimeofday(3)** as well as providing a monotonic (incrementing only) clock in microseconds.

## COLOPHON

**This page is part of libbson.** Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.
