Skip to content

Commit

Permalink
fix mixup with time64
Browse files Browse the repository at this point in the history
  • Loading branch information
enricozb committed Aug 26, 2024
1 parent 084a2ee commit 71ea5c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/c/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,6 @@ Port io_seek(Net* net, Book* book, Port argm) {
return inject_ok(net, new_port(ERA, 0));
}

// TODO: write a time64() function that returns the time as fast as possible as a u64
__host__ __device__ inline u64 time64() {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (u64)ts.tv_sec * 1000000000ULL + (u64)ts.tv_nsec;
}

// Returns the current time as a tuple of the high
// and low 24 bits of a 48-bit nanosecond timestamp.
// Returns: Result<(u24, u24), IOError<*>>
Expand Down
7 changes: 7 additions & 0 deletions src/cuda/run.cu
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,13 @@ Port io_seek(GNet* gnet, Port argm) {
return gnet_inject_ok(gnet, new_port(ERA, 0));
}

// TODO: write a time64() function that returns the time as fast as possible as a u64
__host__ __device__ inline u64 time64() {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (u64)ts.tv_sec * 1000000000ULL + (u64)ts.tv_nsec;
}

// Returns the current time as a tuple of the high
// and low 24 bits of a 48-bit nanosecond timestamp.
// Returns: Result<(u24, u24), IOError<*>>
Expand Down

0 comments on commit 71ea5c8

Please sign in to comment.