How do I properly make this code C++ in Kotlin/Native?
long ns;
struct timespec spec;
clock_gettime(CLOCK_REALTIME, &spec);
ns = spec.tv_nsec;
I came up with this Kotlin/Native syntax but I can't access the tv_nsec member of the timespec struct and this is the only working code so far:
val spec: CValuesRef<timespec>? = null
clock_gettime(CLOCK_REALTIME, spec)
to actually access the output, I would need the following code (right)?:
var ns: Long
val spec: CValuesRef<timespec>? = null
clock_gettime(CLOCK_REALTIME, spec)
ns = spec.tv_nsec
So, how do I correctly do this?