cfad47cfa3/t3compiler/tads3/test/data/prop_perf.t

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
1
/*
2
 *   performance timing test for property getter 
3
 */
4
#include <tads.h>
5
6
class A: object
7
    prop1 = 'this is A.prop1'
8
;
9
10
class B: A
11
;
12
13
class C: B
14
    prop1()
15
    {
16
        return inherited();
17
    }
18
;
19
20
class D: B
21
    prop1()
22
    {
23
        return inherited();
24
    }
25
;
26
27
class E: C, D
28
    prop1()
29
    {
30
        return inherited();
31
    }
32
;
33
34
class F: E
35
;
36
37
main(args)
38
{
39
    local x;
40
    local startTime = getTime(GetTimeTicks);
41
    
42
    for (local i = 1 ; i < 100000 ; ++i)
43
        x = F.prop1();
44
45
    "done - x = <<x>>,
46
    time = <<getTime(GetTimeTicks) - startTime>> milliseconds\n";
47
}
48