 #include <cuComplex.h>
 #include <getopt.h>
 #include <cmath>
+#include <sys/time.h>
 #include "offset.h"
 #include "bitmap.h"
 #include "png_writer.h"

  Offset offset(lowerX, upperX, lowerY, upperY);
  generateImage(width, height, offset, maxThreads, filename, quiet);

  return 0;
}

  dim3 threadsPerBlock(threadsPerBlock1dim, threadsPerBlock1dim);
  dim3 numBlocks(numBlocksX, numBlocksY);

  double iStart = cpuSecond();

  calc<<<numBlocks, threadsPerBlock>>>(offset, bitmap, quiet);
  cudaDeviceSynchronize();

  Pixel* devicePixels = bitmap.pixels;
  bitmap.pixels = new Pixel[pixelsCount];
  cudaMemcpy(bitmap.pixels, devicePixels, pixelsSize, cudaMemcpyDeviceToHost);

  double iElaps = cpuSecond() - iStart;
  // if (!quiet)
    printf("Execution time on gpu: %lf\n", iElaps);

  writePNG(bitmap, filename);

  cudaFree(devicePixels);
