0

Recently i've been writing a simple compiler in C++ that translates the code written in my custom language into nasm for linux. Everything works fine, I've written a sliding puzzles solver in my language too, but i need to know how much time it takes. Do anyone know how to make a timer in NASM? Thanks!

Mattia F.
  • 1,720
  • 11
  • 21

1 Answers1

0

From this page it seems that clock_gettime is the best option on Linux.

This blog post has some NASM code that demonstrates how to call the function and this SO answer shows how to link to the function in glibc, as another option.

Community
  • 1
  • 1
R2-Dequeue
  • 638
  • 1
  • 5
  • 15