我有兴趣从kotlin 提供的包中实例化Duration类。Kotlin.time
到目前为止我的代码..
...
import kotlin.time
class MyGLRenderer : GLSurfaceView.Renderer {
override fun onSurfaceCreated(unused: GL10, config: EGLConfig) {
var tp0:Duration= Duration(10L)
//cannot acces `<init>:` it is internal in `Duration` }
override fun onDrawFrame(unused: GL10) {}
override fun onSurfaceChanged(unused: GL10, width: Int, height: Int) {}
}
Run Code Online (Sandbox Code Playgroud)
那么我该如何实现这个意图呢?
我也尝试过:
var tp0:Duration= Duration(Duration.)
//to find a getter or setter that can be used to pass the required `long` data type to
// the constructor but no function will return long …Run Code Online (Sandbox Code Playgroud)