Skip to content

Commit

Permalink
2563
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamySkrell committed Feb 27, 2024
1 parent 2890e64 commit 4f17175
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ image = "*"
getrandom = { features = ["js"] }
log = "0.4.20"
fern = "0.6.2"
instant = "0.1.12"
instant = { version = "0.1", features = ["wasm-bindgen", "inaccurate"] }

[build-dependencies]
lalrpop = "0.19"
11 changes: 3 additions & 8 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
use std::time::SystemTime;

pub struct ModuleHelper {
start_time: std::time::Duration,
start_time: instant::Instant,
name: String,
}

impl ModuleHelper {
pub fn new(name: &str) -> Self {
log::info!("{}; start...;", name);
let start_time = SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap();
log::info!("{}; start2...;", name);
let start_time = instant::Instant::now();
ModuleHelper {
start_time,
name: name.to_string(),
Expand All @@ -21,9 +18,7 @@ impl ModuleHelper {

impl Drop for ModuleHelper {
fn drop(&mut self) {
let end_time = SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap();
let end_time = instant::Instant::now();
let duration = end_time - self.start_time;

log::info!(
Expand Down
31 changes: 26 additions & 5 deletions wasmtool/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8" />
<title>AURORA-DMM-TOOLS</title>
<title>DREAMY-DMM-TOOLS</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"
Expand All @@ -15,11 +15,32 @@
>
<section class="section">
<div class="container">
<h1 class="title">Hello World</h1>
<p class="subtitle">My first website with <strong>Bulma</strong>!</p>
<h1 class="title">Dreamy's DMM Auto-Tools</h1>
<p class="subtitle">
This is a "static site", it works only within your browser, and you
don't download any .exe files. This page cannot access anything that
you don't give it access to. Browsers generally are safe, or at least
a million times safer than downloading random .exe files from the
internet.
<a
href="https://github.com/DreamySkrell/dmm_parser_rs_stuff/tree/main"
>Full code is here.</a
>
</p>
<div class="columns">
<div class="column">First column</div>
<div class="column">
<h1>Options</h1>
</div>
<div class="column">
<h1>Usage</h1>
<ol>
<li>make a commit so you don't lose any work if this fails</li>
<li>select options, see instructions</li>
<li>prepare the map like instructed in the selected options</li>
<li>click the button below to select a dmm file to process</li>
<li>wait a few seconds</li>
<li>save the resulting dmm file</li>
</ol>
<div class="file has-name is-boxed">
<label class="file-label" id="uploadButton">
<span class="file-cta">
Expand All @@ -33,7 +54,7 @@ <h1 class="title">Hello World</h1>
</div>
</div>
<div class="column">
<h2>Code Element</h2>
<h1>Logs</h1>
<pre id="logs"></pre>
</div>
</div>
Expand Down

0 comments on commit 4f17175

Please sign in to comment.