flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
fasmnewbie 25 Jan 2018, 04:04
Have lots of spare time today, so here goes nothing ;D
Attached is a simple timer DLL for Win32 meant to be accessed from C or probably C++. Actually I stole the code from BASELIB's "bkernel.asm" source. These two routines use QueryPerformanceCounter. You can use them without any time.h hassle in your source. Example Code: // // Demo using timer functions from timer32.dll // gcc -m32 this.c timer32.dll -o this.exe // #include <stdio.h> extern int* timer_on(); //from timer32.dll extern void timer_off(int *); //from timer32.dll int main() { double x = 45.3345; int *p = NULL; p = timer_on(); //timed loop for (int y=1000; y > 0; y--) printf("%.4f",x); timer_off(p); return (0); } Should print the output of the timed code and the output of timer in seconds. I would probably make the linux and 64-bit versions if time permits. Source code, the DLL and C test code are attached. Happy working, peeps! ;D
|
|||||||||||
![]() |
|
yeohhs 26 Jan 2018, 00:45
Thanks for sharing.
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.