Mock getProcessCPUTime for WASM environments

This commit is contained in:
Alex Browne 2019-11-04 14:39:44 -08:00
parent 39aed255bd
commit 32c34330a5
No known key found for this signature in database
GPG key ID: CA6B8D4AFA783512
2 changed files with 10 additions and 1 deletions

9
metrics/cpu_js.go Normal file
View file

@ -0,0 +1,9 @@
// +build js,wasm
package metrics
// getProcessCPUTime is mocked for js/wasm environments. Currently it alwasy
// returns 0.
func getProcessCPUTime() int64 {
return 0
}

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// +build !windows
// +build !windows,!js
package metrics