Skip to content
Snippets Groups Projects
Commit e2282716 authored by Adrien Crovato's avatar Adrien Crovato
Browse files

remove unstable test timers

parent d5f1faf3
No related branches found
No related tags found
1 merge request!1Version 0.1.0 (setup)
Pipeline #2350 failed
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 University of Liège
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Test the timers
# Adrien Crovato
import fpm
import time
from fwk.testing import *
from fwk.coloring import ccolors
def main():
tms = fpm.Timers()
tms['1'].start()
time.sleep(0.3)
tms['1'].stop()
tms['2'].start()
tic = time.perf_counter()
dummy()
toc = time.perf_counter()
tms['2'].stop()
print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET)
print(tms)
print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
tests = CTests()
tests.add(CTest('1w', tms['1'].getWall(), 0.3, 2e-2))
tests.add(CTest('1u', tms['1'].getCpu(), 0.0, 1e-2))
tests.add(CTest('2w', tms['2'].getWall(), toc - tic, 2e-2))
tests.add(CTest('2u', tms['2'].getCpu(), toc - tic, 2e-2))
tests.run()
def dummy():
for i in range(0, int(1e7)):
a = 1+1
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment