Is there anything like "time" command (Linux) on AmigaOS 4? I wrote a simple tool that uses gettimeofday() + system() to get some figures but maybe there are better tools already?
Here is the source, very little tested:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
static char buffer[1024];
int main(int argc, char** argv)
{
for (int i = 1; i < argc; i++) {
int len = strlen(buffer);
snprintf(buffer + len, sizeof(buffer) - len, "%s ", argv[i]);
}
//printf("buffer '%s'\n", buffer);
struct timeval before, after;
gettimeofday(&before, NULL);
int result = system(buffer);
gettimeofday(&after, NULL);
uint32_t duration = (after.tv_sec - before.tv_sec) * 1000000 + (after.tv_usec - before.tv_usec);
printf("\nCommand result %d. Duration [%u] microseconds or [%u] milliseconds\n", result, duration, duration / 1000);
return 0;
}