• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16var __extends = (this && this.__extends) || (function () {
17    var extendStatics = function (d, b) {
18        extendStatics = Object.setPrototypeOf ||
19            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
21        return extendStatics(d, b);
22    };
23    return function (d, b) {
24        if (typeof b !== "function" && b !== null)
25            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
26        extendStatics(d, b);
27        function __() { this.constructor = d; }
28        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
29    };
30})();
31var Animal = /** @class */ (function () {
32    function Animal() {
33        this.name = "Animal";
34    }
35    Animal.prototype.sayHello = function () {
36    };
37    return Animal;
38}());
39var Dog = /** @class */ (function (_super) {
40    __extends(Dog, _super);
41    function Dog(age) {
42        var _this = _super.call(this) || this;
43        _this.age = age;
44        return _this;
45    }
46    return Dog;
47}(Animal));
48var dog = new Dog(6);
49var start = new Date().getTime();
50for (var i = 0; i < 1000000000; i++) {
51    dog.sayHello();
52    var age = dog.age;
53    var s = dog.name;
54}
55var time = new Date().getTime() - start;
56print(time);
57