Path: blob/main/test/browser/test_glfw_time.c
4150 views
/*1* Copyright 2017 The Emscripten Authors. All rights reserved.2* Emscripten is available under two separate licenses, the MIT license and the3* University of Illinois/NCSA Open Source License. Both these licenses can be4* found in the LICENSE file.5*/67#include <assert.h>8#include <stdio.h>9#include <GLFW/glfw3.h>1011int main() {12if (!glfwInit()) {13return 1;14}1516float t = glfwGetTime();17printf("glfwGetTime() = %f\n", t);1819printf("glfwSetTime(50)\n");20glfwSetTime(50);2122// Expect time to be slightly greater than what we set23t = glfwGetTime();24printf("glfwGetTime() = %f\n", t);25assert(t < 50 + 1e-3);2627glfwTerminate();2829return 0;30}313233