Skip to content

Commit

Permalink
Comment blockgeneration time and add print outputword
Browse files Browse the repository at this point in the history
  • Loading branch information
HyoungsungKim committed Jun 8, 2020
1 parent d5256b1 commit 4dd9bca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions consensus/eccpow/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ outerLoop:
close(goRoutineSignal)
close(innerLoopSignal)
fmt.Printf("Codeword is founded with nonce = %d\n", goRoutineNonce)
fmt.Printf("Codeword : %d\n", goRoutineOutputWord)
hashVector = goRoutineHashVector
outputWord = goRoutineOutputWord
LDPCNonce = goRoutineNonce
Expand Down
13 changes: 6 additions & 7 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ package miner

import (
"bytes"
"encoding/csv"
"errors"
"math/big"
"os"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -599,12 +597,13 @@ func (w *worker) resultLoop() {
log.Info("Successfully sealed new block", "number", block.Number(), "sealhash", sealhash, "hash", hash,
"elapsed", common.PrettyDuration(time.Since(task.createdAt)))

csvFile, _ := os.OpenFile("elapseTime.csv", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)

wr := csv.NewWriter(csvFile)
wr.Write([]string{block.Number().String(), time.Since(task.createdAt).String()})
wr.Flush()
/*
csvFile, _ := os.OpenFile("elapseTime.csv", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
wr := csv.NewWriter(csvFile)
wr.Write([]string{block.Number().String(), time.Since(task.createdAt).String()})
wr.Flush()
*/
// Broadcast the block and announce chain insertion event
w.mux.Post(core.NewMinedBlockEvent{Block: block})

Expand Down

0 comments on commit 4dd9bca

Please sign in to comment.