File: clock.cpp

package info (click to toggle)
ltt-control 2.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,744 kB
  • sloc: cpp: 207,706; sh: 28,837; python: 18,952; ansic: 11,636; makefile: 3,362; java: 109; xml: 46
file content (20 lines) | stat: -rw-r--r-- 361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * SPDX-FileCopyrightText: 2023 Kienan Stewart <kstewart@efficios.com>
 *
 * SPDX-License-Identifier: LGPL-2.1-only
 */

#include "common/format.hpp"
#include "common/time.hpp"

int main()
{
	struct timespec t;
	const auto ret = lttng_clock_gettime(CLOCK_MONOTONIC, &t);

	if (ret == 0) {
		fmt::print("{}.{:09d}\n", t.tv_sec, t.tv_nsec);
	}

	return ret;
}