mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fixes name clashes and uses Node-compatible typings where possible.
Changes:
- setTimout et al now return NodeJS.Timer instead of number
- No "console" module anymore. Everyone uses it through global.console
anyway.
- We have a typed "global" instance with exposed properties now. Any
"freeform" accesses must go through a `(<any>global).blah` cast.
- remove tns-core-modules.{base,es6,es2015}.d.ts. Those were needed
as workarounds for the ES6/DOM/Node type clashes.
14 lines
350 B
TypeScript
14 lines
350 B
TypeScript
import * as application from "application";
|
|
declare var CACurrentMediaTime;
|
|
|
|
(<any>global).time = function(): number {
|
|
if (global.android) {
|
|
return java.lang.System.nanoTime() / 1000000; // 1 ms = 1000000 ns
|
|
}
|
|
else {
|
|
return CACurrentMediaTime() * 1000;
|
|
}
|
|
}
|
|
|
|
application.start({ moduleName: "css-perf-test/root" });
|