#include <dlfcn.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char** argv){
  for (int i=1;i<argc;i++){
    struct timespec a,b; clock_gettime(CLOCK_MONOTONIC,&a);
    void*h=dlopen(argv[i], RTLD_LAZY|RTLD_LOCAL);
    clock_gettime(CLOCK_MONOTONIC,&b);
    printf("%s -> %p in %.1f ms err=%s\n", argv[i], h, (b.tv_sec-a.tv_sec)*1e3+(b.tv_nsec-a.tv_nsec)/1e6, h? "":dlerror());
  }
  return 0;
}
