3 Copyright (c) 2011-2013 ARM Limited
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
19 from mbed_host_tests
import BaseHostTest
23 """ This test is reading single characters from stdio
24 and measures time between their occurrences.
30 def _callback_exit(self, key, value, timeout):
31 self.notify_complete()
33 def _callback_tick(self, key, value, timestamp):
35 self.log(
"tick! " + str(timestamp))
36 self.
ticksticks.append((key, value, timestamp))
43 def sub_timestamps(t1, t2):
45 deviation = abs(delta - 1.0)
47 return deviation <= self.
DEVIATIONDEVIATION
52 timestamps = [timestamp
for _, _, timestamp
in self.
ticksticks]
53 self.log(str(timestamps))
54 m = map(sub_timestamps, timestamps[1:], timestamps[:-1])
def _callback_exit(self, key, value, timeout)
def _callback_tick(self, key, value, timestamp)