Welcome to the CHICKEN Scheme pasting service

Compiled C code in the REPL added by aportnoy on Sun Oct 10 17:10:33 2021

microseconds.c:
#include <time.h>
unsigned long current_microseconds(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (unsigned long)(1e6*ts.tv_sec + ts.tv_nsec/1e3);
}

microseconds.scm:
#>
extern unsigned long current_microseconds(void);
<#
(define current-microseconds (foreign-lambda unsigned-long "current_microseconds"))

bash:
gcc -Wall -Wextra -O3 -pedantic -std=gnu99 -c microseconds.c
csc -s microseconds.c microseconds.scm

csi:
#;1> (load "microseconds.so")
; loading microseconds.so ...
#;2> (current-microseconds)
40677968507

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
     _              __      
  __| |_ __   __ _ / _| ___ 
 / _` | '_ \ / _` | |_ / _ \
| (_| | | | | (_| |  _|  __/
 \__,_|_| |_|\__,_|_|  \___|
                            
Visually impaired? Let me spell it for you (wav file) download WAV