Just a quick app to test and demonstrate how to get run times from a specific thread on FreeBSD.
24 lines
523 B
C++
24 lines
523 B
C++
/*
|
|
* SPDX-FileCopyrightText: 2025 Eilertsens Kodeknekkeri
|
|
* SPDX-FileCopyrightText: 2025 The FreeBSD Foundation
|
|
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#ifndef __HELPERS_HPP
|
|
#define __HELPERS_HPP
|
|
|
|
#include <stdexcept>
|
|
#include <unistd.h>
|
|
|
|
extern pid_t ktid;
|
|
|
|
/*
|
|
* Simple helper to turn struct timeval into unsigned long.
|
|
*/
|
|
inline unsigned long timeval_to_long(struct timeval time) {
|
|
return (time.tv_sec * 1000 + time.tv_usec) * 1000;
|
|
}
|
|
|
|
#endif
|