Tensorflow.js tf.util.now() Function
Tensorflow.js is an open-source library which is being develop by Google for running machine learning models as well as deep learning neural networks in the browser or node environment.
The .util.now() function is used to find the present time in milliseconds which is of high resolution and is relative to an inconsistent time in the past. Moreover, it operates through various platforms namely node.js, browsers.
Syntax:
tf.util.now()
Parameters:
It does not accepts any parameter.
Return Value: It returns number.
Example 1:
Javascript
// Importing the tensorflow.js libraryimport * as tf from "@tensorflow/tfjs" // Calling tf.util.now() method and// printing outputconsole.log(tf.util.now()); |
Output:
1106999.345
Example 2:
Javascript
// Importing the tensorflow.js libraryimport * as tf from "@tensorflow/tfjs" // Calling tf.sin() and tf.util.now() // methodsvar res = (tf.sin(tf.util.now())); // printing outputconsole.log(res); |
Output:
Tensor
0.6055543422698975Reference: https://js.tensorflow.org/api_node/2.0.1/#util.now





Please Login to comment...