ghc-dup: b0d75dac247b7095993a95c8fb351a380c302b81

     1: #!/usr/bin/env python
     2: 
     3: import math
     4: import os
     5: from os import *
     6: from sys import *
     7: try:
     8:     from resource import *
     9: except:
    10:     # We don't have resource, so this is a non-UNIX machine.
    11:     # It's probably a reasonable modern x86/x86_64 machines, so we'd
    12:     # probably calibrate to 300 anyway; thus just print 300.
    13:     print 300
    14:     exit(0)
    15: 
    16: compiler = argv[1]
    17: compiler_name = os.path.basename(compiler)
    18: 
    19: spawnl(os.P_WAIT, compiler,
    20:                   compiler_name, 'TimeMe.hs', '-o', 'TimeMe', '-O2')
    21: spawnl(os.P_WAIT, './TimeMe', 'TimeMe')
    22: 
    23: xs = getrusage(RUSAGE_CHILDREN);
    24: x = int(math.ceil(xs[0] + xs[1]))
    25: if x < 1:
    26:     x = 1
    27: print (300*x)
    28: 

Generated by git2html.