---
name: "dtk_difftime_ms"
section: "3"
platform: "linux"
package: "libdrawtk-dev"
version: "2.0-2.1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/dtk_difftime_s"
---

# dtk\_difftime\_ms(3)

timestamp difference

Part of [dtk\_difftime\_s(3)](/dtk_difftime_s/3.md).

## NAME

dtk\_difftime\_s, dtk\_difftime\_ms, dtk\_difftime\_us, dtk\_difftime\_ns - timestamp difference

## SYNOPSIS

**#include \<dtk\_time.h\>**

**long dtk\_difftime\_s(const struct dtk\_timespec\*** *ts***,**\
                     **const struct dtk\_timespec\*** *orig***);**\
 **long dtk\_difftime\_ms(const struct dtk\_timespec\*** *ts***,**\
                      **const struct dtk\_timespec\*** *orig***);**\
 **long dtk\_difftime\_us(const struct dtk\_timespec\*** *ts***,**\
                      **const struct dtk\_timespec\*** *orig***);**\
 **long dtk\_difftime\_ns(const struct dtk\_timespec\*** *ts***,**\
                      **const struct dtk\_timespec\*** *orig***);**\

## DESCRIPTION

These functions returns the difference of time from *orig* to *ts*.

**dtk\_difftime\_s**() returns the difference in seconds.

**dtk\_difftime\_ms**() returns the difference in milliseconds.

**dtk\_difftime\_us**() returns the difference in microseconds.

**dtk\_difftime\_ns**() returns the difference in nanoseconds.

## RETURN VALUE

All the functions return the difference of time.

## SEE ALSO

[**dtk\_nanosleep**(3)](/dtk_nanosleep/3.md), [**dtk\_gettime**(3)](/dtk_gettime/3.md), [**dtk\_addtime**(3)](/dtk_addtime/3.md)
