2 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 if sys.version[0] != "2":
23 f = open('ranges', 'r')
27 r = line.rstrip().split(':')
34 # find directories with results
35 for root, dirs, files in os.walk('OUTPUT'):
36 path = root.rsplit('/',1)
37 if path[len(path)-1] not in ['cold','warm','preload']:
40 # open file with measurements
42 output = open(root + '/outpucik-points', 'r')
44 # find matching points
49 r[3] = l.split(',')[1]
51 r[4] = l.split(',')[1]
55 # calculate the difference
57 r[5] = int(r[4]) - int(r[3])
60 results = open(root + '/outpucik-results','w')
62 print " " + r[0] + ": " + str(float(r[5])/1000) + "ms"
63 results.write(r[0] + ": " + str(float(r[5])/1000) + "ms\n")
66 if __name__ == "__main__":