Files
nym/cpu-cycles/libcpucycles/cpucycles/s390x-stckf.c
Drazen Urch 7bd1550195 libcpucycles (#3219)
* Checkpoint

* cpu cycle ffi

* Rename

* mixnode feature

* Bundle libcpucycles
2023-03-27 16:34:10 +02:00

21 lines
382 B
C

// version 20230106
// public domain
// djb
// adapted from sparc64-rdtick.c
#include "cpucycles_internal.h"
long long ticks(void)
{
long long result;
asm volatile("stckf 0(%0)" :: "a"(&result) : "memory","cc");
return result;
}
long long ticks_setup(void)
{
if (!cpucycles_works(ticks)) return cpucycles_SKIP;
return 4096000000; // manual says 2^12 per microsecond
}